Skip to content

Commit 782404f

Browse files
Hugo docsy upgrade (#2771)
* Upgrade Hugo to 0.164.0 and Docsy to 0.16.0 The repo was pinned to Hugo 0.148.2 and Docsy 0.10.0, six Docsy minor releases behind. Docsy 0.16.0 requires Hugo 0.160.1 or later and is validated against 0.164.0, so both move together. Docsy 0.16.0 breaking changes: - The theme moved into theme/, so the module import path becomes github.com/google/docsy/theme. - Bootstrap and Font Awesome are npm dependencies rather than Hugo modules, so github.com/google/docsy/dependencies is dropped and `hugo mod npm pack` generates packages/hugoautogen/. Re-run it, then `npm install`, whenever Docsy is updated. - PostCSS is opt-in for sites with no RTL language and no PostCSS config of their own, so autoprefixer, postcss, and postcss-cli are removed. - Docsy no longer ships default favicon artwork. Six of the ten icons the site linked came from Docsy, not this repository; the new default partial only discovers icons in static/, while ours live in static/favicons/. layouts/_partials/favicons.html keeps every existing icon URL and uses Selenium's own pwa-*.png in place of Docsy's. Hugo changes between 0.148.2 and 0.164.0: - Language config and template APIs were renamed in 0.158.0: languageName -> label, .Language.Lang -> .Language.Name, .Language.LanguageName -> .Language.Label. - .Site.Data was deprecated in 0.156.0 in favour of hugo.Data. - The gist and twitter/tweet shortcodes were removed in 0.156.0. tweet is replaced by the built-in x shortcode; gist is replaced by a local shortcode reproducing Hugo's removed template. - text/html content files are denied by default from 0.162.0, so security.allowContent explicitly allows the .html landing pages this site publishes. - The global imaging.quality setting was deprecated in 0.163.0. It was set to 75, already Hugo's default, so removing it changes no output. - .Render now fails the build on a missing view template instead of rendering nothing, which surfaced meetings/single.html calling the Docsy content view by its pre-0.16 name. Alias handling (Hugo 0.155.0, gohugoio/hugo#14388): Aliases on a page in a non-default language are now published relative to that language's site root rather than the publish root, because languages previously clobbered each other's aliases. Both alias styles in this repo had to move, and all 508 affected URLs still publish at their current paths: - 260 aliases already carrying their own language prefix would have been published twice-prefixed (/ja/ja/...). The prefix is now dropped from front matter and Hugo adds it. - 248 legacy /documentation/<lang>/... aliases predate the 2021 restructure and sit at the site root, which is the English namespace. A translated page can no longer publish there, so they move to the English counterpart. The URLs keep working; they now resolve to the English page rather than the translated one. Verified against a 0.148.2 baseline build: llms.txt is byte-identical, tab rendering is unchanged, canonical and hreflang links are intact, and no non-print URL is lost. The 224 remaining differences are noindex meta-refresh stubs of print-format aliases, which Hugo no longer renders for unrendered pages. * Remove translated pages whose legacy URLs now resolve to English The previous commit moved 248 legacy /documentation/<lang>/... aliases onto their English counterparts, because Hugo 0.155.0 no longer lets a translated page publish an alias at the site root. Those URLs kept working but started resolving to the English page rather than the translated one. Rather than keep translated pages that the legacy URLs no longer reach, this removes them and redirects every URL they published: - 209 translated pages deleted (70 ja, 69 pt-br, 70 zh-cn), leaving roughly 54 translated documentation pages per language. - 426 URLs preserved as aliases on the English counterparts, covering each deleted page's own permalink and every alias it carried, so nothing 404s. Permalinks were taken from `hugo list all` rather than derived from file paths. - 97 `ref` shortcodes in the 51 surviving translated pages pointed at deleted pages. Hugo resolves refs within the current language, so they now pass lang="en" and resolve against the English page, matching where those URLs redirect. Only the file and line positions Hugo reported are changed, so refs to translated pages that still exist are untouched. Verified by diffing the built output against the pre-deletion build: every URL still resolves except /ja/documentation/webdriver/ja/documentation/webdriver/browser/, a doubled path produced by an alias that was missing its leading slash. The URL it was meant to create, /ja/documentation/webdriver/browser/, did not exist before this change either. The other 48 differences are noindex print-format copies of the deleted pages. --------- [deploy site]
1 parent 241e506 commit 782404f

388 files changed

Lines changed: 1081 additions & 35039 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/deploy.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Hugo
1919
uses: peaceiris/actions-hugo@v3
2020
with:
21-
hugo-version: ' 0.148.2'
21+
hugo-version: '0.164.0'
2222
extended: true
2323
- name: Build
2424
run: chmod +x build-site.sh && ./build-site.sh

‎.github/workflows/link-check.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Hugo
2626
uses: peaceiris/actions-hugo@v3
2727
with:
28-
hugo-version: ' 0.148.2'
28+
hugo-version: '0.164.0'
2929
extended: true
3030

3131
- name: Setup Node

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Hugo
2222
uses: peaceiris/actions-hugo@v3
2323
with:
24-
hugo-version: '0.148.2'
24+
hugo-version: '0.164.0'
2525
extended: true
2626
- name: Build
2727
run: chmod +x build-site.sh && ./build-site.sh

‎.gitpod.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
tasks:
22
- name: Install Hugo, init submodules and start website
33
init: |
4-
curl -LO https://github.com/gohugoio/hugo/releases/download/v0.148.2/hugo_extended_0.148.2_linux-amd64.deb && \
5-
sudo dpkg -i hugo_extended_0.148.2_linux-amd64.deb && \
6-
sudo rm hugo_extended_0.148.2_linux-amd64.deb
4+
curl -LO https://github.com/gohugoio/hugo/releases/download/v0.164.0/hugo_extended_0.164.0_linux-amd64.deb && \
5+
sudo dpkg -i hugo_extended_0.164.0_linux-amd64.deb && \
6+
sudo rm hugo_extended_0.164.0_linux-amd64.deb
77
command: |
88
cd website_and_docs
99
hugo server --baseURL $(gp url 1313) --appendPort=false

‎README.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,24 @@ This is the repository used to build and publish the official Selenium [website]
1717
We use [Hugo](https://gohugo.io/) and the [Docsy theme](https://www.docsy.dev/)
1818
to build and render the site. You will need the **extended**
1919
Sass/SCSS version of the Hugo binary to work on this site. We recommend
20-
to use **[Hugo 0.148.2](https://github.com/gohugoio/hugo/releases/tag/v0.148.2)**
20+
to use **[Hugo 0.164.0](https://github.com/gohugoio/hugo/releases/tag/v0.164.0)**
2121

2222
Steps needed to have this working locally and work on it:
2323

2424
- [Install Hugo](https://gohugo.io/installation/) and follow the [Get Started](https://www.docsy.dev/docs/get-started/) instructions from Docsy
2525
- [Install go](https://go.dev/doc/install)
26+
- [Install Node.js](https://nodejs.org/) (LTS 24)
2627
- Clone this repository
2728
- Run `cd website_and_docs`
29+
- Run `npm install`
2830
- Run `hugo server`
2931

32+
`npm install` is required, not optional: since Docsy 0.16.0 the theme's
33+
Bootstrap and Font Awesome assets are npm packages rather than Hugo modules.
34+
Skipping it makes the build fail with SCSS import errors. If you ever change
35+
the Docsy version, run `hugo mod npm pack` first to refresh
36+
`packages/hugoautogen/`, then `npm install` again.
37+
3038
A full contribution guideline can be seen at [contributing](https://selenium.dev/documentation/about/contributing/)
3139

3240
## How to get involved?

‎netlify.toml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ publish = "website_and_docs/public"
33
command = "chmod +x build-site.sh && ./build-site.sh"
44

55
[context.production.environment]
6-
NODE_VERSION = "22.13.0"
7-
HUGO_VERSION = "0.148.2"
8-
GO_VERSION = "1.20.1"
6+
NODE_VERSION = "24.19.0"
7+
HUGO_VERSION = "0.164.0"
8+
GO_VERSION = "1.25.5"
99
HUGO_ENV = "production"
1010

1111
[context.deploy-preview]
1212
command = "chmod +x build-site.sh && ./build-site.sh"
1313

1414
[context.deploy-preview.environment]
15-
NODE_VERSION = "22.13.0"
16-
HUGO_VERSION = "0.148.2"
17-
GO_VERSION = "1.20.1"
15+
NODE_VERSION = "24.19.0"
16+
HUGO_VERSION = "0.164.0"
17+
GO_VERSION = "1.25.5"
1818

1919
[context.branch-deploy]
2020
command = "chmod +x build-site.sh && ./build-site.sh"
2121

2222
[context.branch-deploy.environment]
23-
NODE_VERSION = "22.13.0"
24-
HUGO_VERSION = "0.148.2"
25-
GO_VERSION = "1.20.1"
23+
NODE_VERSION = "24.19.0"
24+
HUGO_VERSION = "0.164.0"
25+
GO_VERSION = "1.25.5"

‎website_and_docs/assets/scss/_nav.scss‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
font-variant: normal;
117117
text-rendering: auto;
118118
-webkit-font-smoothing: antialiased;
119-
font-family: $font-awesome-font-name;
119+
font-family: $td-font-awesome-font-name;
120120
font-weight: 900;
121121
content: "\f0d9";
122122
padding-left: 0.5em;
@@ -171,7 +171,7 @@ nav.foldable-nav {
171171
font-variant: normal;
172172
text-rendering: auto;
173173
-webkit-font-smoothing: antialiased;
174-
font-family: $font-awesome-font-name;
174+
font-family: $td-font-awesome-font-name;
175175
font-weight: 900;
176176
content: "\f0da";
177177
position: absolute;

‎website_and_docs/assets/scss/_styles_project.scss‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
/*
22
Import of additional project style files.
3+
4+
"alerts" and "nav" are imported explicitly because they used to be picked up
5+
implicitly: until Docsy 0.16.0 the theme kept its own _alerts.scss and
6+
_nav.scss directly under assets/scss/, so Hugo's union filesystem served
7+
these same-named project files in their place. Docsy 0.16.0 moved its
8+
stylesheets under assets/scss/td/, which left both files orphaned. Importing
9+
them here layers them over the theme's versions instead of replacing them,
10+
and _styles_project is imported last so these rules still win.
311
*/
412

13+
@import "alerts";
514
@import "backgrounds";
615
@import "badges";
716
@import "colors_project";
817
@import "images";
918
@import "links";
1019
@import "logo";
20+
@import "nav";
1121
@import "screen";
1222
@import "tabs";
1323

‎website_and_docs/assets/scss/_variables_project.scss‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ Add styles or override variables from the theme here.
44
55
*/
66

7-
$google_font_name: "Encode Sans" !default;
8-
$google_font_family: "Encode+Sans:300,300i,400,400i,700,700i" !default;
9-
$web-font-path: "https://fonts.googleapis.com/css?family=#{$google_font_family}&display=swap";
7+
// Docsy 0.16.0 prefixed these with "td-" and changed $td-enable-google-fonts to
8+
// default to false, so the pre-0.16 names below were silently ignored and the
9+
// site fell back to the Bootstrap system font stack.
10+
//
11+
// $td-web-font-path is not declared !default by the theme, so it is derived
12+
// from $td-google-font-family rather than set here.
13+
$td-enable-google-fonts: true;
14+
$td-google-font-name: "Encode Sans";
15+
$td-google-font-family: "Encode+Sans:300,300i,400,400i,700,700i";
1016

1117
// This overrides the font color for the site
1218
$gray-900: #343A40;

‎website_and_docs/content/blog/2020/selenium-4-alpha-6-is-out.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ We are very pleased to announce the release of <a href="http://www.selenium.dev/
1414

1515
All the information can be seen in different tweets from the project contributors, here they are all in one place:
1616

17-
{{< tweet user="shs96c" id="1266307374941437952" >}}
18-
{{< tweet user="shs96c" id="1266307376279359488" >}}
19-
{{< tweet user="shs96c" id="1266307377420275713" >}}
20-
{{< tweet user="shs96c" id="1266307378485563392" >}}
21-
{{< tweet user="shs96c" id="1266307379513171968" >}}
22-
{{< tweet user="AutomatedTester" id="1266025050706149379" >}}
23-
{{< tweet user="p0deje" id="1266144106885111814" >}}
17+
{{< x user="shs96c" id="1266307374941437952" >}}
18+
{{< x user="shs96c" id="1266307376279359488" >}}
19+
{{< x user="shs96c" id="1266307377420275713" >}}
20+
{{< x user="shs96c" id="1266307378485563392" >}}
21+
{{< x user="shs96c" id="1266307379513171968" >}}
22+
{{< x user="AutomatedTester" id="1266025050706149379" >}}
23+
{{< x user="p0deje" id="1266144106885111814" >}}
2424

2525
Happy hacking!
2626

0 commit comments

Comments
 (0)