Skip to content

Commit 7cd75f0

Browse files
authored
Merge pull request #67 from rocky-linux/fastly
move to fastly
2 parents a2107e0 + b237807 commit 7cd75f0

19 files changed

+55374
-8
lines changed

.envrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export FASTLY_SERVICE_ID="lACFUzQjUGLnZsvoHgcnx6"
2+
export PATH="$PATH:$PWD/compute-js/bin"
3+
4+
[[ -f .envrc.local ]] && source .envrc.local

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Public output
22
site/
33
public/
4+
build/
45

56
# Docs sources
67
docs/
8+
9+
# mkdocs cache
10+
.cache
11+
12+
# dev envrc
13+
.envrc.local
14+
15+
node_modules/

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ repos:
99
- id: check-yaml
1010
args: [--unsafe]
1111
- id: check-added-large-files
12+
- repo: https://github.com/boidolr/pre-commit-images
13+
rev: v1.5.2
14+
hooks:
15+
- id: optimize-png
16+
- id: optimize-svg
17+
- id: optimize-jpg

build-all.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
test -d build || mkdir build
4+
5+
cleanup() {
6+
echo -e "\nScript interrupted. Exiting..."
7+
exit 1
8+
}
9+
10+
trap cleanup INT
11+
12+
source .envrc
13+
14+
# Build the site
15+
mkdocs build -d build/site
16+
17+
# hardlink duplicates
18+
command -v hardlink && hardlink -t build/site || echo "no hardlink in $PATH"
19+
20+
MINIFY=$(command -v minify || echo "./compute-js/bin/minify")
21+
# minify everything
22+
test -d build/minified || $MINIFY -r --sync --preserve=all -o build/minified build/site
23+
24+
STRIP_NONENGLISH_LOCALES=${STRIP_LOCALES:-true}
25+
if ${STRIP_NONENGLISH_LOCALES}; then
26+
# remove locales from minified (Fastly) site
27+
for locale in $(yq -r '.plugins[] | select(type == "object" and has("i18n")) | .i18n.languages[].locale' < mkdocs.yml | grep -v 'en'); do
28+
rm -fr "build/minified/site/$locale"
29+
done
30+
fi

compute-js/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules
2+
/bin
3+
/pkg
4+
/static-publisher

compute-js/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# temporarily override until https://github.com/fastly/compute-js-static-publish/pull/13 is merged
2+
npm config set @fastly:registry https://git.resf.org/api/packages/sig_core/npm/

compute-js/.publish-id

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Generated by @fastly/compute-js-static-publish.
2+
2qS5iaeanC9NRRLK1pSoYu

compute-js/fastly.toml

Lines changed: 51675 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)