Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docsy upgrade #803

Merged
merged 8 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
[submodule "themes/docsy"]
path = themes/docsy
url = https://github.com/cncf/docsy.git
branch = etcd.io
1 change: 1 addition & 0 deletions .htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ IgnoreURLs:
- "^http://example.com"
- "^http://example.com"

IgnoreInternalEmptyHash: true # because `docsy/layouts/partials/navbar-version-selector.html` uses `href="#"` and that lands everywhere
IgnoreInternalURLs:
- /docs/latest/
- /docs/latest/install/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Follow these steps to add documentation for a newly released version of etcd, vX
* Add the version to the `params.versions.all` array in the
[config.toml](config.toml) configuration file.
* If the version is meant to be the latest version of etcd, change the
`params.versions.latest` parameter to the desired new version.
`params.latest_stable_version` parameter to the desired new version.
* Submit a pull request with the changes.

[#406]: https://github.com/etcd-io/website/issues/406
Expand Down
56 changes: 41 additions & 15 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
baseURL: https://etcd.io
enableRobotsTxt: true

theme: [docsy]
module:
replacements: 'github.com/FortAwesome/Font-Awesome -> ., github.com/twbs/bootstrap -> .'
imports:
- path: docsy

themesDir: "node_modules" # docsy is installed via npm

# Will give values to .Lastmod etc.
enableGitInfo: true
Expand Down Expand Up @@ -56,7 +61,19 @@ markup:
# Everything below this are Site Params

params:
copyright: etcd Authors
copyright:
from_year: 2013
authors: |
etcd Authors

<div class="row text-center text-white small">
<div class="col-12 text-center py-2 order-sm-2">
<a href="https://www.linuxfoundation.org/terms" target="_blank" rel="noopener">Terms</a> |
<a href="https://www.linuxfoundation.org/privacy" target="_blank" rel="noopener">Privacy</a> |
<a href="https://www.linuxfoundation.org/trademark-usage" target="_blank" rel="noopener">Trademarks</a> |
<a href="https://github.com/etcd-io/website/blob/main/LICENSE" target="_blank" rel="noopener">License</a>
</div>
</div>
description: >-
A distributed, reliable key-value store for the most critical data of a
distributed system
Expand All @@ -82,26 +99,35 @@ params:
# Menu title if your navbar has a versions selector to access old versions of your site.
# This menu appears only if you have at least one [params.versions] set.
version_menu: Versions
latest_stable_version: v3.5
versions:
latest: v3.5
all:
- v3.6
- v3.5
- v3.4
- v3.3
- v3.2
- v3.1
- v2.3
deprecation_warning: |-
the documentation is no longer actively maintained.
The page that you are viewing is the last archived version.
- version: v3.6
url: /docs/v3.6/

- version: v3.5
url: /docs/v3.5/

- version: v3.4
url: /docs/v3.4/

- version: v3.3
url: /docs/v3.3/

- version: v3.2
url: /docs/v3.2/

- version: v3.1
url: /docs/v3.1/

- version: v2.3
url: /docs/v2.3/

# User interface configuration
ui:
sidebar_menu_compact: true
sidebar_search_disable: true
navbar_logo: true
footer_about_disable: true
footer_about_enable: false
navbar_translucent_over_cover_disable: true

# Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events.
Expand Down
6 changes: 3 additions & 3 deletions content/en/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ <h2 class="mt-4">
A distributed, reliable key-value store for the most critical data of a distributed system
</h2>
<div class="mt-5 mx-auto">
<a class="btn btn-lg btn-secondary mr-3 mb-4" href="/docs/{{< param versions.latest >}}/">
<a class="btn btn-lg btn-secondary mr-3 mb-4" href="/docs/{{< param latest_stable_version >}}/">
Learn more
</a>
<a class="btn btn-lg btn-primary mr-3 mb-4" href="/docs/{{< param versions.latest >}}/quickstart">
<a class="btn btn-lg btn-primary mr-3 mb-4" href="/docs/{{< param latest_stable_version >}}/quickstart">
Quickstart<i class="fas fa-arrow-alt-circle-right ml-2"></i>
</a>
</div>
Expand All @@ -36,7 +36,7 @@ <h1>What is etcd?</h1>
distributed system or cluster of machines. It gracefully handles leader
elections during network partitions and can tolerate machine failure, even
in the leader node.
<a href="/docs/{{< param versions.latest >}}/">Learn more<i class="fas fa-arrow-alt-circle-right ml-2"></i></a>
<a href="/docs/{{< param latest_stable_version >}}/">Learn more<i class="fas fa-arrow-alt-circle-right ml-2"></i></a>
</p>
{{% /blocks/lead %}}

Expand Down
2 changes: 1 addition & 1 deletion layouts/index.redirects
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $latest := site.Params.versions.latest }}
{{ $latest := site.Params.latest_stable_version }}
/docs/latest /docs/{{ $latest }}/
/docs/latest/* /docs/{{ $latest }}/:splat

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
"submodule:update": "git submodule update --remote --recursive --depth 1"
},
"devDependencies": {
"autoprefixer": "^10.4.16",
"hugo-extended": "^0.110.0",
"autoprefixer": "^10.4.18",
"docsy": "github:google/docsy#semver:0.9.1",
"hugo-extended": "^0.123.8",
"netlify-cli": "^17.15.2",
"postcss": "^8.4.31",
"postcss-cli": "^11.0.0"
Expand Down
1 change: 0 additions & 1 deletion themes/docsy
Submodule docsy deleted from 1062ef