Docsy upgrade (#803)

* git rm -r themes/docsy

Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>

* npm install --save-dev google/docsy#semver:0.9.1 autoprefixer postcss-cli; add themes directory setting

Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>

* Move to new docsy versions configuration

Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>

* Move to new theme configuration

Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>

* Fix deprecated Hugo setting

Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>

* Upgrade hugo-extended to fix build error about `WorkingDir` property

Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>

* Ignore empty hash because docsy uses `href="#"`

Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>

* Add back etcd-specific footer override

Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>

---------

Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>
This commit is contained in:
Andreas Sommer 2024-03-22 14:50:51 +01:00 committed by GitHub
parent e02a91c8fd
commit 72387f933f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 50 additions and 27 deletions

4
.gitmodules vendored
View File

@ -1,4 +0,0 @@
[submodule "themes/docsy"]
path = themes/docsy
url = https://github.com/cncf/docsy.git
branch = etcd.io

View File

@ -17,6 +17,7 @@ IgnoreURLs:
- "^http://example.com" - "^http://example.com"
- "^http://example.com" - "^http://example.com"
IgnoreInternalEmptyHash: true # because `docsy/layouts/partials/navbar-version-selector.html` uses `href="#"` and that lands everywhere
IgnoreInternalURLs: IgnoreInternalURLs:
- /docs/latest/ - /docs/latest/
- /docs/latest/install/ - /docs/latest/install/

View File

@ -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 * Add the version to the `params.versions.all` array in the
[config.toml](config.toml) configuration file. [config.toml](config.toml) configuration file.
* If the version is meant to be the latest version of etcd, change the * 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. * Submit a pull request with the changes.
[#406]: https://github.com/etcd-io/website/issues/406 [#406]: https://github.com/etcd-io/website/issues/406

View File

@ -2,7 +2,12 @@
baseURL: https://etcd.io baseURL: https://etcd.io
enableRobotsTxt: true 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. # Will give values to .Lastmod etc.
enableGitInfo: true enableGitInfo: true
@ -56,7 +61,19 @@ markup:
# Everything below this are Site Params # Everything below this are Site Params
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: >- description: >-
A distributed, reliable key-value store for the most critical data of a A distributed, reliable key-value store for the most critical data of a
distributed system distributed system
@ -82,26 +99,35 @@ params:
# Menu title if your navbar has a versions selector to access old versions of your site. # 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. # This menu appears only if you have at least one [params.versions] set.
version_menu: Versions version_menu: Versions
latest_stable_version: v3.5
versions: versions:
latest: v3.5 - version: v3.6
all: url: /docs/v3.6/
- v3.6
- v3.5 - version: v3.5
- v3.4 url: /docs/v3.5/
- v3.3
- v3.2 - version: v3.4
- v3.1 url: /docs/v3.4/
- v2.3
deprecation_warning: |- - version: v3.3
the documentation is no longer actively maintained. url: /docs/v3.3/
The page that you are viewing is the last archived version.
- version: v3.2
url: /docs/v3.2/
- version: v3.1
url: /docs/v3.1/
- version: v2.3
url: /docs/v2.3/
# User interface configuration # User interface configuration
ui: ui:
sidebar_menu_compact: true sidebar_menu_compact: true
sidebar_search_disable: true sidebar_search_disable: true
navbar_logo: true navbar_logo: true
footer_about_disable: true footer_about_enable: false
navbar_translucent_over_cover_disable: true 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. # Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events.

View File

@ -19,10 +19,10 @@ features:
A distributed, reliable key-value store for the most critical data of a distributed system A distributed, reliable key-value store for the most critical data of a distributed system
</h2> </h2>
<div class="mt-5 mx-auto"> <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 Learn more
</a> </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> Quickstart<i class="fas fa-arrow-alt-circle-right ml-2"></i>
</a> </a>
</div> </div>
@ -36,7 +36,7 @@ features:
distributed system or cluster of machines. It gracefully handles leader distributed system or cluster of machines. It gracefully handles leader
elections during network partitions and can tolerate machine failure, even elections during network partitions and can tolerate machine failure, even
in the leader node. 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> </p>
{{% /blocks/lead %}} {{% /blocks/lead %}}

View File

@ -1,4 +1,4 @@
{{ $latest := site.Params.versions.latest }} {{ $latest := site.Params.latest_stable_version }}
/docs/latest /docs/{{ $latest }}/ /docs/latest /docs/{{ $latest }}/
/docs/latest/* /docs/{{ $latest }}/:splat /docs/latest/* /docs/{{ $latest }}/:splat

View File

@ -16,8 +16,9 @@
"submodule:update": "git submodule update --remote --recursive --depth 1" "submodule:update": "git submodule update --remote --recursive --depth 1"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.18",
"hugo-extended": "^0.110.0", "docsy": "github:google/docsy#semver:0.9.1",
"hugo-extended": "^0.123.8",
"netlify-cli": "^17.15.2", "netlify-cli": "^17.15.2",
"postcss": "^8.4.31", "postcss": "^8.4.31",
"postcss-cli": "^11.0.0" "postcss-cli": "^11.0.0"

@ -1 +0,0 @@
Subproject commit 1062ef052ec07632cba7468aa436627289efc4fb