Skip to content
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: 3 additions & 1 deletion .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ jobs:

- run: npm ci
working-directory: website_and_docs
- run: hugo --destination $GITHUB_WORKSPACE/website_and_docs/public
- run: |
source ../scripts/setup-dart-sass-path.sh
hugo --destination $GITHUB_WORKSPACE/website_and_docs/public
working-directory: website_and_docs

- name: Link check
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ GEMINI.local.md

website_and_docs/.hugo_build.lock
website_and_docs/resources
website_and_docs/.hugo-sass-bin
*.png
*.log
*.py[cod]
Expand Down
2 changes: 2 additions & 0 deletions build-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ rm -rf website_and_docs/public
echo -e "\033[0;32mSwitching to Docsy theme directory...\033[0m"
cd website_and_docs && npm install

source ../scripts/setup-dart-sass-path.sh

echo -e "\033[0;32mGenerating Hugo site for website...\033[0m"
echo -e "\033[0;32mUsing SELENIUM_EXAMPLES_REPO=${SELENIUM_EXAMPLES_REPO} SELENIUM_EXAMPLES_ORG=${SELENIUM_EXAMPLES_ORG} SELENIUM_EXAMPLES_BRANCH=${SELENIUM_EXAMPLES_BRANCH} hugo --minify ${USE_BASE_URL_SITE}...\033[0m"
SELENIUM_EXAMPLES_REPO=${SELENIUM_EXAMPLES_REPO} SELENIUM_EXAMPLES_ORG=${SELENIUM_EXAMPLES_ORG} SELENIUM_EXAMPLES_BRANCH=${SELENIUM_EXAMPLES_BRANCH} hugo --minify ${USE_BASE_URL_SITE}
Expand Down
21 changes: 21 additions & 0 deletions scripts/setup-dart-sass-path.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# Source this from website_and_docs (after `npm install`/`npm ci`) before
# invoking hugo, so its Dart Sass transpiler can find a working "sass"
# binary on $PATH.
#
# Two gaps otherwise block it:
# - npm only installs binaries into node_modules/.bin, which isn't on
# $PATH by default outside of npm-run scripts.
# - The sass-embedded package (Docsy's Dart Sass compiler) and its own
# optional "sass" fallback dependency both ship a bin named "sass".
# npm's install order lets the fallback claim node_modules/.bin/sass,
# and that fallback refuses embedded-protocol mode ("sass --embedded
# is unavailable in pure JS mode"), which hugo needs. Point PATH at
# sass-embedded's own script directly, ahead of node_modules/.bin.
set -e

rm -rf .hugo-sass-bin
mkdir .hugo-sass-bin
ln -s "$(pwd)/node_modules/sass-embedded/dist/bin/sass.js" .hugo-sass-bin/sass
chmod +x node_modules/sass-embedded/dist/bin/sass.js
export PATH="$(pwd)/.hugo-sass-bin:$(pwd)/node_modules/.bin:${PATH}"
2 changes: 1 addition & 1 deletion website_and_docs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/SeleniumHQseleniumhq.github.io

go 1.20

require github.com/google/docsy/theme v0.16.0
require github.com/google/docsy/theme v0.17.0
2 changes: 2 additions & 0 deletions website_and_docs/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/google/docsy/theme v0.16.0 h1:9uV9qEhk7UpJ8KYbSpTPQlq6htH+8hYskedgGZVnNsU=
github.com/google/docsy/theme v0.16.0/go.mod h1:NX/JqXCbZBn9Q2Hj7ez9Xeh9z4XcLiwmDYZXhB4RhRM=
github.com/google/docsy/theme v0.17.0 h1:eQaQcvg20bxI21nKylsERCK/xkCITj0Sqf3ae/NDRdo=
github.com/google/docsy/theme v0.17.0/go.mod h1:NX/JqXCbZBn9Q2Hj7ez9Xeh9z4XcLiwmDYZXhB4RhRM=
5 changes: 4 additions & 1 deletion website_and_docs/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,10 @@ year = "year"
# markdown plus the HTML we already publish, rather than the '.*' catch-all.
allowContent = ['^text/markdown$', '^text/html$']
[security.exec]
allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$', '^git$']
# 'sass' is the CLI binary shipped by the sass-embedded npm package
# (Docsy 0.17.0's Dart Sass transpiler); 'dart-sass-embedded' was the
# older package's binary name, kept here in case it's still resolved.
allow = ['^dart-sass-embedded$', '^sass$', '^go$', '^npx$', '^postcss$', '^git$']
osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']

[security.funcs]
Expand Down
Loading
Loading