Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to fastly #67

Merged
merged 6 commits into from
Mar 29, 2024
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: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export FASTLY_SERVICE_ID="lACFUzQjUGLnZsvoHgcnx6"
export PATH="$PATH:$PWD/compute-js/bin"

[[ -f .envrc.local ]] && source .envrc.local
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Public output
site/
public/
build/

# Docs sources
docs/

# mkdocs cache
.cache

# dev envrc
.envrc.local

node_modules/
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ repos:
- id: check-yaml
args: [--unsafe]
- id: check-added-large-files
- repo: https://github.com/boidolr/pre-commit-images
rev: v1.5.2
hooks:
- id: optimize-png
- id: optimize-svg
- id: optimize-jpg
30 changes: 30 additions & 0 deletions build-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

test -d build || mkdir build

cleanup() {
echo -e "\nScript interrupted. Exiting..."
exit 1
}

trap cleanup INT

source .envrc

# Build the site
mkdocs build -d build/site

# hardlink duplicates
command -v hardlink && hardlink -t build/site || echo "no hardlink in $PATH"

MINIFY=$(command -v minify || echo "./compute-js/bin/minify")
# minify everything
test -d build/minified || $MINIFY -r --sync --preserve=all -o build/minified build/site

STRIP_NONENGLISH_LOCALES=${STRIP_LOCALES:-true}
if ${STRIP_NONENGLISH_LOCALES}; then
# remove locales from minified (Fastly) site
for locale in $(yq -r '.plugins[] | select(type == "object" and has("i18n")) | .i18n.languages[].locale' < mkdocs.yml | grep -v 'en'); do
rm -fr "build/minified/site/$locale"
done
fi
4 changes: 4 additions & 0 deletions compute-js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules
/bin
/pkg
/static-publisher
2 changes: 2 additions & 0 deletions compute-js/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# temporarily override until https://github.com/fastly/compute-js-static-publish/pull/13 is merged
npm config set @fastly:registry https://git.resf.org/api/packages/sig_core/npm/
2 changes: 2 additions & 0 deletions compute-js/.publish-id
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by @fastly/compute-js-static-publish.
2qS5iaeanC9NRRLK1pSoYu
51,675 changes: 51,675 additions & 0 deletions compute-js/fastly.toml

Large diffs are not rendered by default.

Loading