File tree Expand file tree Collapse file tree 7 files changed +63
-16
lines changed Expand file tree Collapse file tree 7 files changed +63
-16
lines changed Original file line number Diff line number Diff line change 1+ export FASTLY_SERVICE_ID=" lACFUzQjUGLnZsvoHgcnx6"
2+
3+ [[ -f .envrc.local ]] && source .envrc.local
Original file line number Diff line number Diff line change 88
99# mkdocs cache
1010.cache
11+
12+ # dev envrc
13+ .envrc.local
Original file line number Diff line number Diff line change @@ -9,24 +9,16 @@ cleanup() {
99
1010trap cleanup INT
1111
12- export INSIDERS=true
13- #
14- # Build main site
15- # export BUILD_ONLY_LOCALE=en
16- CLEAN=" ${CLEAN:- 1} "
17- [[ $CLEAN ]] && mkdocs build -d build/site
18-
19- # for locale in $(yq -r '.plugins[] | select(type == "object" and has("i18n")) | .i18n.languages[].locale' < mkdocs.yml | grep -v 'en'); do
20- # export BUILD_ONLY_LOCALE=$locale
21- #
22- # # Run mkdocs build for the current locale
23- # mkdocs build -d "site/$locale"
24- # done
12+ # Build the site
13+ mkdocs build -d build/site
2514
2615# hardlink duplicates
2716hardlink -t build/site
2817
2918# minify everything
3019test -d build/minified || minify -r --sync --preserve=all -o build/minified build/site
3120
32- du -hs build/*
21+ # remove locales from minified (Fastly) site
22+ for locale in $( yq -r ' .plugins[] | select(type == "object" and has("i18n")) | .i18n.languages[].locale' < mkdocs.yml | grep -v ' en' ) ; do
23+ rm -fr " build/minified/site/$locale "
24+ done
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ cleanup () {
4+ echo -e " \nScript interrupted. Exiting..."
5+ exit 1
6+ }
7+
8+ trap cleanup INT
9+
10+ FASTLY=$( command -v fastly || echo " ./compute-js/bin/fastly" )
11+
12+ test -x " $FASTLY " || exit 2
13+
14+ source .envrc
15+
16+ if [[ -z $FASTLY_API_TOKEN ]]; then
17+ # shellcheck disable=2016
18+ echo ' missing $FASTLY_API_TOKEN'
19+ fi
20+ if [[ -z $FASTLY_SERVICE_ID ]]; then
21+ # shellcheck disable=2016
22+ echo ' missing $FASTLY_API_TOKEN'
23+ fi
24+
25+ pushd compute-js || exit $?
26+ $FASTLY compute build || exit $?
27+ $FASTLY compute deploy -p pkg/resf-rocky-linux-docs.tar.gz
28+
29+ popd || exit
Original file line number Diff line number Diff line change 55 "scripts" : {
66 "load-docs" : " rm -rf docs; git clone https://github.com/rocky-linux/documentation docs" ,
77 "dev" : " mkdocs serve" ,
8- "build" : " pip install 'urllib3<2' && mkdocs build"
8+ "build" : " bash setup-deps.sh && bash build-all.sh && bash deploy.sh "
99 }
1010}
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ cleanup () {
4+ echo -e " \nScript interrupted. Exiting..."
5+ exit 1
6+ }
7+
8+ trap cleanup INT
9+
10+ pip install ' urllib3<2' yq
11+ pip install -r requirements.txt
12+
13+ # Only install insiders package if it's available
14+ if [[ -n " $GH_TOKEN " ]]; then
15+ pip install " git+https://${GH_TOKEN} @github.com/squidfunk/mkdocs-material-insiders.git"
16+ fi
17+
18+ test -d compute-js/bin || mkdir compute-js/bin
19+ test -f compute-js/bin/fastly || ( curl -Ls https://github.com/fastly/cli/releases/download/v10.8.3/fastly_v10.8.3_linux-amd64.tar.gz | tar -xzf /dev/stdin -C compute-js/bin/ )
Original file line number Diff line number Diff line change 11{
2- "trailingSlash" : true
2+ "trailingSlash" : true ,
3+ "outputDirectory" : " build/site"
34}
You can’t perform that action at this time.
0 commit comments