aboutsummaryrefslogtreecommitdiff
path: root/aux
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-10-04 09:51:16 -0300
committerEuAndreh <eu@euandre.org>2021-10-05 15:55:03 -0300
commitd808811e1542517182d4ab4154d978d7e9fe3408 (patch)
treed25ecd24db98f67846829523c8144b4687645ec9 /aux
parentTODOs.md: Add #td-94511264-e301-be51-23e2-cf960dcd603d (diff)
downloadeuandre.org-d808811e1542517182d4ab4154d978d7e9fe3408.tar.gz
euandre.org-d808811e1542517182d4ab4154d978d7e9fe3408.tar.xz
aux/: Update
Diffstat (limited to '')
-rw-r--r--aux/containers/guix/pinned-channels.scm11
-rwxr-xr-xaux/workflow/commonmark.sh9
-rwxr-xr-xaux/workflow/public.sh28
3 files changed, 33 insertions, 15 deletions
diff --git a/aux/containers/guix/pinned-channels.scm b/aux/containers/guix/pinned-channels.scm
deleted file mode 100644
index 504406f..0000000
--- a/aux/containers/guix/pinned-channels.scm
+++ /dev/null
@@ -1,11 +0,0 @@
-(cons*
- (channel
- (name 'xyz-euandreh)
- (url "git://euandreh.xyz/package-repository")
- (branch "main")
- (introduction
- (make-channel-introduction
- "d749e053e6db365069cb9b2ef47a78b06f9e7361"
- (openpgp-fingerprint
- "5BDA E9B8 B2F6 C6BC BB0D 6CE5 81F9 0EC3 CD35 6060"))))
- %default-channels)
diff --git a/aux/workflow/commonmark.sh b/aux/workflow/commonmark.sh
index 39aacb4..088d447 100755
--- a/aux/workflow/commonmark.sh
+++ b/aux/workflow/commonmark.sh
@@ -1,7 +1,7 @@
#!/bin/sh
set -eu
-while getopts 'N:t:l:' flag; do
+while getopts 'N:t:l:H:' flag; do
case "$flag" in
N)
PROJECT_UC="$OPTARG"
@@ -12,6 +12,9 @@ while getopts 'N:t:l:' flag; do
l)
THE_LANG="$OPTARG"
;;
+ H)
+ ALTERNATES="$OPTARG"
+ ;;
*)
exit 2
;;
@@ -29,6 +32,7 @@ assert_arg() {
assert_arg "${PROJECT_UC:-}" '-N PROJECT_UC'
assert_arg "${TITLE:-}" '-t TITLE'
assert_arg "${THE_LANG:-}" '-l THE_LANG'
+assert_arg "${ALTERNATES:-}" '-H ALTERNATES'
pandoc \
--toc \
@@ -40,4 +44,5 @@ pandoc \
-r commonmark \
-w html \
-H aux/workflow/favicon.html \
- -H aux/workflow/style.css
+ -H aux/workflow/style.css \
+ -H "$ALTERNATES"
diff --git a/aux/workflow/public.sh b/aux/workflow/public.sh
index 38613de..2c8c36a 100755
--- a/aux/workflow/public.sh
+++ b/aux/workflow/public.sh
@@ -1,6 +1,9 @@
#!/bin/sh
set -eu
+TLD="$(cat aux/tld.txt)"
+. aux/lib.sh
+
PROJECT_UC=
while getopts 'n:N:m:o:l:' flag; do
case "$flag" in
@@ -39,6 +42,23 @@ assert_arg "${OUTDIR:-}" '-o OUTDIR'
assert_arg "${LANGS:-}" '-l LANGS'
PROJECT_UC="${PROJECT_UC:-$PROJECT}"
+
+alternates_for() {
+ ALTERNATES="$(mkstemp)"
+ lang="$1"
+ OUTNAME="$2"
+ for l in $LANGS; do
+ if [ "$l" = "$lang" ]; then
+ continue
+ fi
+ cat <<EOF >> "$ALTERNATES"
+<link rel="alternate" href="https://$TLD/$PROJECT/$l/$OUTNAME" hreflang="$l" />
+EOF
+ done
+ echo "$ALTERNATES"
+}
+
+
mkdir -p "$OUTDIR"
sh aux/workflow/TODOs.sh \
@@ -46,9 +66,13 @@ sh aux/workflow/TODOs.sh \
for lang in $LANGS; do
mkdir -p "$OUTDIR/$lang/"
- sh aux/workflow/commonmark.sh -N "$PROJECT" -t README -l "$lang" \
+ sh aux/workflow/commonmark.sh \
+ -N "$PROJECT" -l "$lang" -t README \
+ -H "$(alternates_for "$lang" '')" \
< "README.$lang.md" > "$OUTDIR/$lang/index.html"
- sh aux/workflow/commonmark.sh -N "$PROJECT" -t CHANGELOG -l "$lang" \
+ sh aux/workflow/commonmark.sh \
+ -N "$PROJECT" -l "$lang" -t CHANGELOG \
+ -H "$(alternates_for "$lang" 'CHANGELOG.html')" \
< "CHANGELOG.$lang.md" > "$OUTDIR/$lang/CHANGELOG.html"
ln -fs ../favicon.svg "$OUTDIR/$lang"
done