File tree 7 files changed +62
-16
lines changed
7 files changed +62
-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 8
8
9
9
# mkdocs cache
10
10
.cache
11
+
12
+ # dev envrc
13
+ .envrc.local
Original file line number Diff line number Diff line change @@ -9,24 +9,16 @@ cleanup() {
9
9
10
10
trap cleanup INT
11
11
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
25
14
26
15
# hardlink duplicates
27
16
hardlink -t build/site
28
17
29
18
# minify everything
30
19
test -d build/minified || minify -r --sync --preserve=all -o build/minified build/site
31
20
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 5
5
"scripts" : {
6
6
"load-docs" : " rm -rf docs; git clone https://github.com/rocky-linux/documentation docs" ,
7
7
"dev" : " mkdocs serve" ,
8
- "build" : " pip install 'urllib3<2' && mkdocs build"
8
+ "build" : " bash setup-deps.sh && bash build-all.sh && bash deploy.sh "
9
9
}
10
10
}
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 -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 1
1
{
2
- "trailingSlash" : true
2
+ "trailingSlash" : true ,
3
+ "outputDirectory" : " build/site"
3
4
}
You can’t perform that action at this time.
0 commit comments