From ee71be14a05d0d7da38352f8ff5c19798f96d4eb Mon Sep 17 00:00:00 2001
From: EuAndreh
#: src/lib/comment.en.html:3
msgid ""
@@ -67,7 +164,7 @@ msgstr ""
#. type: Plain text
#: src/content/en/about.md:1 src/content/en/about.md:5
#: src/content/en/pastebins/sicp-exercise-3-19.md:1
-#: src/content/en/pastebins/sicp-exercise-3-19.md:7
+#: src/content/en/pastebins/sicp-exercise-3-19.md:9
#, no-wrap
msgid "---\n"
msgstr ""
@@ -93,12 +190,17 @@ msgid "date: 2021-09-02"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:10
+#: src/content/en/pastebins/sicp-exercise-3-19.md:8
+msgid "categories: lisp programming-languages"
+msgstr ""
+
+#. type: Plain text
+#: src/content/en/pastebins/sicp-exercise-3-19.md:12
msgid "Some content here, before:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:20
+#: src/content/en/pastebins/sicp-exercise-3-19.md:22
#, no-wrap
msgid ""
"```scheme\n"
@@ -113,12 +215,12 @@ msgid ""
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:22
+#: src/content/en/pastebins/sicp-exercise-3-19.md:24
msgid "Sample interactive session:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:39
+#: src/content/en/pastebins/sicp-exercise-3-19.md:41
#, no-wrap
msgid ""
"```scheme\n"
@@ -140,93 +242,93 @@ msgid ""
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:41
+#: src/content/en/pastebins/sicp-exercise-3-19.md:43
msgid "# An h1"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:43
+#: src/content/en/pastebins/sicp-exercise-3-19.md:45
msgid "a list:"
msgstr ""
#. type: Bullet: '1. '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:47
+#: src/content/en/pastebins/sicp-exercise-3-19.md:49
#, markdown-text
msgid "one"
msgstr ""
#. type: Bullet: '2. '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:47
+#: src/content/en/pastebins/sicp-exercise-3-19.md:49
#, markdown-text
msgid "two"
msgstr ""
#. type: Bullet: '3. '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:47
+#: src/content/en/pastebins/sicp-exercise-3-19.md:49
#, markdown-text
msgid "three"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:49
+#: src/content/en/pastebins/sicp-exercise-3-19.md:51
msgid "some content."
msgstr ""
#. type: Bullet: '- '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:53
+#: src/content/en/pastebins/sicp-exercise-3-19.md:55
#, markdown-text
msgid "item"
msgstr ""
#. type: Bullet: '- '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:53
+#: src/content/en/pastebins/sicp-exercise-3-19.md:55
#, markdown-text
msgid "another"
msgstr ""
#. type: Bullet: '- '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:53
+#: src/content/en/pastebins/sicp-exercise-3-19.md:55
#, markdown-text
msgid "yet another"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:55
+#: src/content/en/pastebins/sicp-exercise-3-19.md:57
msgid "## An h2"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:57
+#: src/content/en/pastebins/sicp-exercise-3-19.md:59
msgid "Xablau:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:60
+#: src/content/en/pastebins/sicp-exercise-3-19.md:62
msgid "``` xupliu 1"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:63
+#: src/content/en/pastebins/sicp-exercise-3-19.md:65
msgid "3 4"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:70
+#: src/content/en/pastebins/sicp-exercise-3-19.md:72
msgid "dez ```"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:72
+#: src/content/en/pastebins/sicp-exercise-3-19.md:74
msgid "Foi `wikiwiu`."
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:74
+#: src/content/en/pastebins/sicp-exercise-3-19.md:76
msgid "a very long code block:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:80
+#: src/content/en/pastebins/sicp-exercise-3-19.md:82
#, no-wrap
msgid ""
"```\n"
@@ -238,27 +340,27 @@ msgid ""
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:82
+#: src/content/en/pastebins/sicp-exercise-3-19.md:84
msgid "Someone said:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:84
+#: src/content/en/pastebins/sicp-exercise-3-19.md:86
msgid "> Xablau, xupliu."
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:87
+#: src/content/en/pastebins/sicp-exercise-3-19.md:89
msgid "### A repeated header ### A repeated header"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:89
+#: src/content/en/pastebins/sicp-exercise-3-19.md:91
msgid "a big list:"
msgstr ""
#. type: Bullet: '1. '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:107
+#: src/content/en/pastebins/sicp-exercise-3-19.md:109
#, markdown-text
msgid "a"
msgstr ""
diff --git a/v2/po/pt.po b/v2/po/pt.po
index dd60fea..2df706c 100644
--- a/v2/po/pt.po
+++ b/v2/po/pt.po
@@ -1,3 +1,48 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: 2023-04-08 12:41-0300\n"
+"PO-Revision-Date: \n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 2.2.4\n"
+
+#. type: Plain text
+#: src/content/img/alt/atom.en.txt:1
+msgid "three yellow lines representing an Atom feed"
+msgstr ""
+
+#. type: Plain text
+#: src/content/img/alt/envelope.en.txt:1
+msgid "an envelope icon representing an email address"
+msgstr ""
+
+#. type: Plain text
+#: src/content/img/alt/favicon.en.txt:1
+msgid "a crude hand doing a thumbs up"
+msgstr ""
+
+#. type: Plain text
+#: src/content/img/alt/link.en.txt:1
+msgid "two chain rings, representing an anchor to this header"
+msgstr ""
+
+#. type: Plain text
+#: src/content/img/alt/linkto.en.txt:1
+msgid ""
+"a drawing of a box with an arrow going outwards, representing an internal "
+"link"
+msgstr ""
+
+#. type: Plain text
+#: src/content/img/alt/lock.en.txt:1
+msgid "a lock icon representing a GPG public key"
+msgstr ""
+
#. type: Plain text
#: src/lib/base.en.conf:2
msgid "export date_fmt='%B %-d, %Y'"
@@ -10,14 +55,79 @@ msgstr ""
#. type: Plain text
#: src/lib/base.en.conf:6
+msgid "export lang='en'"
+msgstr "export lang='pt'"
+
+#. type: Plain text
+#: src/lib/base.en.conf:8
+msgid "export index_pastebins_title='Pastebins'"
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:10
+msgid "export index_recent_pastebins_title='Pastebins listing'"
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:12
+msgid "export index_category_pastebins_title='Pastebins by category'"
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:14
+msgid "export index by_category_url_part='by-category.html'"
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:16
+msgid "export feed_pastebins_title=\"EuAndreh's pastebins\""
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:18
+msgid "export index_tils_title='TIL'"
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:20
+msgid "export index_recent_tils_title='TIL listing'"
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:22
+msgid "export index_category_tils_title='TIL by category'"
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:24
+msgid "export feed_tils_title=\"EuAndreh's TIL\""
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:26
msgid "export about='About'"
msgstr ""
#. type: Plain text
-#: src/lib/base.en.conf:7
+#: src/lib/base.en.conf:28
msgid "export about_url_name='about.html'"
msgstr ""
+#. type: Plain text
+#: src/lib/base.en.conf:30
+msgid "export homepage_url=\"$(url-for \"$lang/\")\""
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:32
+msgid "export homepage_url_absolute=\"$(absolute \"$homepage_url\")\""
+msgstr ""
+
+#. type: Plain text
+#: src/lib/base.en.conf:33
+msgid "export about_url=\"$(url-for \"$lang/$about_url_name\")\""
+msgstr ""
+
#. type: Content of:
#: src/lib/comment.en.html:3
msgid ""
@@ -48,7 +158,7 @@ msgstr ""
#. type: Plain text
#: src/content/en/about.md:1 src/content/en/about.md:5
#: src/content/en/pastebins/sicp-exercise-3-19.md:1
-#: src/content/en/pastebins/sicp-exercise-3-19.md:7
+#: src/content/en/pastebins/sicp-exercise-3-19.md:9
#, no-wrap
msgid "---\n"
msgstr ""
@@ -74,12 +184,17 @@ msgid "date: 2021-09-02"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:10
+#: src/content/en/pastebins/sicp-exercise-3-19.md:8
+msgid "categories: lisp programming-languages"
+msgstr ""
+
+#. type: Plain text
+#: src/content/en/pastebins/sicp-exercise-3-19.md:12
msgid "Some content here, before:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:20
+#: src/content/en/pastebins/sicp-exercise-3-19.md:22
#, no-wrap
msgid ""
"```scheme\n"
@@ -94,12 +209,12 @@ msgid ""
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:22
+#: src/content/en/pastebins/sicp-exercise-3-19.md:24
msgid "Sample interactive session:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:39
+#: src/content/en/pastebins/sicp-exercise-3-19.md:41
#, no-wrap
msgid ""
"```scheme\n"
@@ -121,87 +236,87 @@ msgid ""
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:41
+#: src/content/en/pastebins/sicp-exercise-3-19.md:43
msgid "# An h1"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:43
+#: src/content/en/pastebins/sicp-exercise-3-19.md:45
msgid "a list:"
msgstr ""
#. type: Bullet: '1. '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:47
+#: src/content/en/pastebins/sicp-exercise-3-19.md:49
msgid "one"
msgstr ""
#. type: Bullet: '2. '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:47
+#: src/content/en/pastebins/sicp-exercise-3-19.md:49
msgid "two"
msgstr ""
#. type: Bullet: '3. '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:47
+#: src/content/en/pastebins/sicp-exercise-3-19.md:49
msgid "three"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:49
+#: src/content/en/pastebins/sicp-exercise-3-19.md:51
msgid "some content."
msgstr ""
#. type: Bullet: '- '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:53
+#: src/content/en/pastebins/sicp-exercise-3-19.md:55
msgid "item"
msgstr ""
#. type: Bullet: '- '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:53
+#: src/content/en/pastebins/sicp-exercise-3-19.md:55
msgid "another"
msgstr ""
#. type: Bullet: '- '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:53
+#: src/content/en/pastebins/sicp-exercise-3-19.md:55
msgid "yet another"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:55
+#: src/content/en/pastebins/sicp-exercise-3-19.md:57
msgid "## An h2"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:57
+#: src/content/en/pastebins/sicp-exercise-3-19.md:59
msgid "Xablau:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:60
+#: src/content/en/pastebins/sicp-exercise-3-19.md:62
msgid "``` xupliu 1"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:63
+#: src/content/en/pastebins/sicp-exercise-3-19.md:65
msgid "3 4"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:70
+#: src/content/en/pastebins/sicp-exercise-3-19.md:72
msgid "dez ```"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:72
+#: src/content/en/pastebins/sicp-exercise-3-19.md:74
msgid "Foi `wikiwiu`."
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:74
+#: src/content/en/pastebins/sicp-exercise-3-19.md:76
msgid "a very long code block:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:80
+#: src/content/en/pastebins/sicp-exercise-3-19.md:82
#, no-wrap
msgid ""
"```\n"
@@ -212,26 +327,26 @@ msgid ""
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:82
+#: src/content/en/pastebins/sicp-exercise-3-19.md:84
msgid "Someone said:"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:84
+#: src/content/en/pastebins/sicp-exercise-3-19.md:86
msgid "> Xablau, xupliu."
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:87
+#: src/content/en/pastebins/sicp-exercise-3-19.md:89
msgid "### A repeated header ### A repeated header"
msgstr ""
#. type: Plain text
-#: src/content/en/pastebins/sicp-exercise-3-19.md:89
+#: src/content/en/pastebins/sicp-exercise-3-19.md:91
msgid "a big list:"
msgstr ""
#. type: Bullet: '1. '
-#: src/content/en/pastebins/sicp-exercise-3-19.md:107
+#: src/content/en/pastebins/sicp-exercise-3-19.md:109
msgid "a"
msgstr ""
diff --git a/v2/src/bin/absolute b/v2/src/bin/absolute
index ecf5a64..f475901 100755
--- a/v2/src/bin/absolute
+++ b/v2/src/bin/absolute
@@ -5,7 +5,7 @@ set -eu
usage() {
cat <<-'EOF'
Usage:
- absolute < STDIN
+ absolute [CONTENT...]
absolute -h
EOF
}
@@ -16,9 +16,13 @@ help() {
Options:
-h, --help show this message
+ CONTENT a literal string to be prefixed
- Read URL from STDIN and adds the FQDN prefix. Meant to be used
- in conjunction with `url-for`.
+
+ Add domain prefix to build a full URL. If CONTENT is not given,
+ get data from STDIN.
+
+ Usually used in conjunction with url-for(1).
Examples:
@@ -27,6 +31,12 @@ help() {
$ url-for 'static/style.css' | absolute
https://euandre.org/static/style.css
+
+
+ Get the absolute variant of a relative URL:
+
+ $ absolute "$homepage_url"
+ https://euandre.org/pt/
EOF
}
@@ -64,4 +74,16 @@ shift $((OPTIND - 1))
. src/lib/base.conf
-printf 'https://%s%s' "$domain" "$(cat)"
+
+prefix() {
+ sed "s|^/\?|https://$domain/|"
+}
+
+
+if [ $# = 0 ]; then
+ prefix
+else
+ for s in "$@"; do
+ printf '%s\n' "$s" | prefix
+ done
+fi
diff --git a/v2/src/bin/categories b/v2/src/bin/categories
new file mode 100755
index 0000000..bc08704
--- /dev/null
+++ b/v2/src/bin/categories
@@ -0,0 +1,80 @@
+#!/bin/sh
+set -eu
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ categories FILENAME
+ categories -h
+ EOF
+}
+
+help() {
+ cat <<-'EOF'
+ Options:
+ -h, --help show this message
+
+ FILENAME the target categories index to be built
+
+
+ Generate FILENAME as the indexed list of articles by category.
+
+
+ Examples:
+
+ Generate the index.categories entry for english pastebins:
+
+ $ categories src/en/pastebins/index.categories
+ EOF
+}
+
+
+for flag in "$@"; do
+ case "$flag" in
+ --)
+ break
+ ;;
+ --help)
+ usage
+ help
+ exit
+ ;;
+ *)
+ ;;
+ esac
+done
+
+while getopts 'h' flag; do
+ case "$flag" in
+ h)
+ usage
+ help
+ exit
+ ;;
+ *)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+. src/lib.sh
+
+FILENAME="${1:-}"
+eval "$(assert_arg "$FILENAME" 'FILENAME')"
+DIR="$(dirname "$FILENAME")"
+
+
+mkdir -p "$DIR"
+printf '' > "$FILENAME"
+find "$DIR"/*.categorysort 2>/dev/null |
+ awk -F. '{ print $(NF-1) }' |
+ sort |
+ uniq |
+ while read -r category; do
+ find "$DIR"/*."$category".categorysort |
+ sort -nr |
+ xargs cat > "$DIR/$category.category"
+ printf '%s\n' "$category" >> "$FILENAME"
+ done
diff --git a/v2/src/bin/category b/v2/src/bin/category
new file mode 100755
index 0000000..2a2fdea
--- /dev/null
+++ b/v2/src/bin/category
@@ -0,0 +1,80 @@
+#!/bin/sh
+set -eu
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ category FILENAME
+ html -h
+ EOF
+}
+
+help() {
+ cat <<-'EOF'
+
+
+ Options:
+ -h, --help show this message
+
+ FILENAME the name of the input file .md file
+
+
+ Process the FILENAME, and generate a the derived category files.
+
+
+ Examples:
+
+ Generate the categories for a pastebin:
+
+ $ categories src/a-paste.md > src/a-paste.categoryentry
+ EOF
+}
+
+
+for f in "$@"; do
+ case "$f" in
+ --)
+ break
+ ;;
+ --help)
+ usage
+ help
+ exit
+ ;;
+ *)
+ ;;
+ esac
+done
+
+while getopts 'h' flag; do
+ case "$flag" in
+ h)
+ usage
+ help
+ exit
+ ;;
+ *)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+. src/lib.sh
+
+FILENAME="${1:-}"
+eval "$(assert_arg "$FILENAME" 'FILENAME')"
+
+
+# shellcheck source=/dev/null
+. "${FILENAME%.md}.conf"
+DIR="$(dirname "$FILENAME")"
+
+
+
+echo "${categories:-}" | tr ' ' '\n' | grep . | while read -r category; do
+ echo "$FILENAME" > "$DIR/${date_iso:?}.$category.categorysort"
+done
+
+envsubst < src/lib/category.html
diff --git a/v2/src/bin/collection-for b/v2/src/bin/collection-for
new file mode 100755
index 0000000..b3fc211
--- /dev/null
+++ b/v2/src/bin/collection-for
@@ -0,0 +1,83 @@
+#!/bin/sh
+set -eu
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ collection-for FILE
+ collection-for -h
+ EOF
+}
+
+help() {
+ cat <<-'EOF'
+
+
+ Options:
+ -h, --help show this message
+
+ FILE the path of the file to get the collection for
+
+
+ Say the collection of the given file, using the path of FILE.
+
+
+ Examples:
+
+ Get "tils" for "src/en/tils/some-pt.md":
+
+ $ collection-for src/en/tils/some-pt.md
+ tils
+ EOF
+}
+
+
+for flag in "$@"; do
+ case "$flag" in
+ --)
+ break
+ ;;
+ --help)
+ usage
+ help
+ exit
+ ;;
+ *)
+ ;;
+ esac
+done
+
+while getopts 'h' flag; do
+ case "$flag" in
+ h)
+ usage
+ help
+ exit
+ ;;
+ *)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+. src/lib.sh
+
+
+FILE="${1:-}"
+eval "$(assert_arg "$FILE" 'FILE')"
+
+
+# echo "${FILE#"$CONTENT_PREFIX"/}" | cut -d/ -f1
+# echo "${FILE#"$CONTENT_PREFIX"/}" | awk '{
+ # awk -F/ '$3 && $0=$2 { print; next } $0'
+
+ATTEMPT="$(echo "${FILE#"$CONTENT_PREFIX"/}" | cut -d/ -f2-)"
+
+if [ "$ATTEMPT" = 'index.html' ]; then
+ echo articles
+else
+ NAME="$(echo "$ATTEMPT" | cut -d/ -f1)"
+ collections | grep "$NAME"
+fi
diff --git a/v2/src/bin/conf b/v2/src/bin/conf
index 5717039..62ef97a 100755
--- a/v2/src/bin/conf
+++ b/v2/src/bin/conf
@@ -5,7 +5,7 @@ set -eu
usage() {
cat <<-'EOF'
Usage:
- conf FILENAME
+ conf [FILENAME]
conf -h
EOF
}
@@ -21,7 +21,8 @@ help() {
Separate the content from the "frontmatter", and emit the
- selected one, given the FILENAME.
+ selected one, given the FILENAME. If FILENAME is not given,
+ generate the global config.
Examples:
@@ -65,11 +66,36 @@ shift $((OPTIND - 1))
. src/lib.sh
+
FILENAME="${1:-}"
-eval "$(assert_arg "$FILENAME" 'FILENAME')"
+if [ -z "$FILENAME" ]; then
+ printf 'export style_url="%s"\n' "$(url-for 'style.css')"
+ printf 'export pubkey_url="%s"\n' "$(url-for 'public.asc.txt')"
+ printf 'export pubkey_id="%s"\n' "$(
+ LANG=C.UTF-8 gpg --list-key "$EMAIL" |
+ awk 'NR==2 { print substr($1, length($1) - 15) }' |
+ shesc
+ )"
+
+ for f in "$CONTENT_PREFIX"/img/*.svg; do
+ name="$(basename "$f" .svg | sed 's|-|_|g')"
+ printf 'export icon_%s_url="%s"\n' "$name" "$(url-for "img/$(basename "$f")")"
+ done
+ for l in $(langs); do
+ for f in "$CONTENT_PREFIX"/img/*.svg; do
+ name="$(basename "$f" .svg | sed 's|-|_|g')"
+ printf 'export icon_%s_alt="%s"\n' "$name" "$(shesc < "$CONTENT_PREFIX/img/alt/$(basename "$f" .svg).$l.txt" )"
+ done > src/lib/generated."$l".conf
+ done
+ exit
+fi
+
+lang="$(lang-for "$FILENAME")"
+export lang
-tee "$FILENAME".tmp < src/lib/base.conf
+cat src/lib/base.conf src/lib/generated.conf src/lib/generated."$lang".conf |
+ tee "$FILENAME".tmp
DELIMITER=0
while read -r line; do
if [ "$line" = '---' ]; then
@@ -92,14 +118,17 @@ done < "$FILENAME" | tee -a "$FILENAME".tmp
rm -f "$FILENAME".tmp
+collection="$(collection-for "$FILENAME" ||:)"
+if [ -n "$collection" ]; then
+ export collection
+ printf 'export collection="%s"\n' "$collection"
+fi
+
if [ -z "${layout:-}" ]; then
- if [ "$(dirname "$(dirname "$FILENAME")")" = "$CONTENT_PREFIX" ]; then
+ if [ -z "$collection" ]; then
layout=page
else
layout=post
- collection="$(basename "$(dirname "$FILENAME")")"
- export collection
- printf 'export collection="%s"\n' "$collection"
custom_layout="$(echo "$LAYOUTS" | grep . |
awk -v coll="$collection" '$1 == coll { print $2 }'
@@ -131,10 +160,10 @@ if [ -n "${date:-}" ]; then
formatted_date="$(LANG="$lang" date -ud "${date:?}" +"${date_fmt:?}")"
export formatted_date
+ printf 'export formatted_date_html="%s"\n' "$(htmlesc "$formatted_date" | shesc)"
printf 'export date_html="%s"\n' "$(envsubst < src/lib/date."$lang".html | shesc)"
- echo "${FILENAME%.md}.xmlentry" > "$(dirname "$FILENAME")/$date_iso.sortdata"
- touch "${FILENAME%.md}.sortref"
+ echo "$FILENAME" > "$(dirname "$FILENAME")/$date_iso.sortdata"
fi
if [ -n "${update:-}" ]; then
@@ -149,31 +178,19 @@ if [ -n "${update:-}" ]; then
fi
-url_part="$(printf '%s' "${FILENAME%.md}.html" | sed "s|^$CONTENT_PREFIX||")"
+url_part="$(printf '%s' "${FILENAME%.md}.html" | sed "s|^$CONTENT_PREFIX/||")"
+url="$(url-for "$url_part")"
title_uri="$(uri "$title")"
printf 'export title_html="%s"\n' "$(printf '%s' "$title" | htmlesc | shesc)"
printf 'export filename="%s"\n' "$FILENAME"
printf 'export url_part="%s"\n' "$url_part"
-printf 'export url="%s"\n' "$(url-for "$url_part" | absolute)"
+printf 'export url="%s"\n' "$url"
+printf 'export url_absolute="%s"\n' "$(absolute "$url")"
printf 'export mailto_uri="%s%s"\n' "${mailto_uri_prefix:?}" "$title_uri"
printf 'export discussions_url="%s%s"\n' "${discussions_url_prefix:?}" "$title_uri"
printf 'export sourcecode_url="%s%s"\n' "${sourcecode_url_prefix:?}" "$FILENAME"
-printf 'export style_url="%s"\n' "$(url-for 'style.css')"
-printf 'export favicon_url="%s"\n' "$(url-for 'favicon.svg')"
-printf 'export pubkey_url="%s"\n' "$(url-for 'public.asc.txt')"
-
-for f in "$CONTENT_PREFIX"/img/*.svg; do
- name="$(basename "$f" .svg | sed 's|-|_|g')"
- printf 'export icon_%s_url="%s"\n' "$name" "$(url-for "img/$(basename "$f")")"
-done
-
-# FIXME: special treatment of root
-printf 'export homepage_url="%s"\n' "$(url-for '/')"
-
-printf 'export about_url="%s"\n' "$(url-for "${about_url_name:?}")"
-
if [ "${layout:-}" = 'post' ]; then
export mailto_uri="$mailto_uri_prefix$title_uri"
diff --git a/v2/src/bin/feed b/v2/src/bin/feed
index 0488c86..52c6199 100755
--- a/v2/src/bin/feed
+++ b/v2/src/bin/feed
@@ -27,7 +27,7 @@ help() {
Generate a feed for TILs:
- $ feed src/en/feeds/til.xml
+ $ feed src/en/tils/feed.xml
EOF
}
@@ -68,24 +68,44 @@ FILENAME="${1:-}"
eval "$(assert_arg "$FILENAME" 'FILENAME')"
-COLLECTION="$(basename "$FILENAME" '.xml')"
-LANGUAGE="$(lang-for "$FILENAME")"
-DIR="$(dirname "$(dirname "$FILENAME")")/$COLLECTION"
-
-
. src/lib/base.conf
# shellcheck source=/dev/null
-. src/lib/base."$LANGUAGE".conf
+. src/lib/base."$(lang-for "$FILENAME")".conf
+
now="$(date -uIs)"
-url="$(url-for "${FILENAME#"$CONTENT_PREFIX"}" | absolute)"
+url_absolute="$(url-for "${FILENAME#"$CONTENT_PREFIX"/}" | absolute)"
site_name_html="$(htmlesc "${site_name:?}")"
-export now url site_name_html
+collection="$(collection-for "$FILENAME")"
+collection_url_absolute="$(url-for "${lang:?}/$collection/" | absolute)"
+feed_title_html="$(eval "echo \"\$feed_${collection}_title\"" | htmlesc)"
+export now url_absolute site_name_html collection_url_absolute feed_title_html
-
-mkdir -p "$(dirname "$FILENAME")"
+DIR="$(dirname "$FILENAME")"
+mkdir -p "$DIR"
{
envsubst < src/lib/feed.xml
- find "$DIR"/*.sortdata 2>/dev/null | sort -nr | xargs cat | xargs cat
+ find "$DIR"/*.sortdata 2>/dev/null |
+ sort -nr |
+ xargs cat |
+ sed 's|\.md$|.xmlentry|' |
+ xargs cat
printf '\n'
} > "$FILENAME"
+
+printf '' > "$DIR"/index.extrafeeds
+while read -r category; do
+ url_absolute="$(url-for "${DIR#"$CONTENT_PREFIX"/}/feed.$category.xml" | absolute)"
+ collection_url_absolute="$(url-for "${DIR#"$CONTENT_PREFIX"/}/${by_category_url_part:?}#$category" | absolute)"
+ feed_title_html="$(eval "echo \"\$index_category_${collection}_title\"" | htmlesc)"
+ export url_absolute collection_url_absolute feed_title_html
+
+ {
+ envsubst < src/lib/feed.xml
+ < "$DIR/$category.category" \
+ sed 's|\.md$|.xmlentry|' |
+ xargs cat
+ printf '\n'
+ } > "$DIR/feed.$category.xml"
+ echo "$DIR/feed.$category.xml" >> "$DIR"/index.extrafeeds
+done < "$DIR"/index.categories
diff --git a/v2/src/bin/index b/v2/src/bin/index
new file mode 100755
index 0000000..36750b3
--- /dev/null
+++ b/v2/src/bin/index
@@ -0,0 +1,128 @@
+#!/bin/sh
+set -eu
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ collection FILENAME
+ collection -h
+ EOF
+}
+
+help() {
+ cat <<-'EOF'
+ Options:
+ -h, --help show this message
+
+ FILENAME the target collection HTML page to be generated
+
+
+ Generate FILENAME as a collection index. The collection type
+ and language are inferred by the name of FILENAME.
+
+
+ Examples:
+
+ Generate an index.html entry for english pastebins:
+
+ $ collection src/en/pastebins/index.html
+ EOF
+}
+
+
+for flag in "$@"; do
+ case "$flag" in
+ --)
+ break
+ ;;
+ --help)
+ usage
+ help
+ exit
+ ;;
+ *)
+ ;;
+ esac
+done
+
+while getopts 'h' flag; do
+ case "$flag" in
+ h)
+ usage
+ help
+ exit
+ ;;
+ *)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+. src/lib.sh
+
+FILENAME="${1:-}"
+eval "$(assert_arg "$FILENAME" 'FILENAME')"
+DIR="$(dirname "$FILENAME")"
+
+
+l="$(lang-for "$FILENAME")"
+. src/lib/base.conf
+. src/lib/generated.conf
+# shellcheck source=/dev/null
+. src/lib/generated."$l".conf
+# shellcheck source=/dev/null
+. src/lib/base."$l".conf
+
+url_part="$(printf '%s' "${FILENAME#"$CONTENT_PREFIX"/}" | sed "s|\.md$|.html|")"
+url_absolute="$(url-for "$url_part" | absolute)"
+collection="$(collection-for "$FILENAME")"
+feed_url="$(url-for "${DIR#"$CONTENT_PREFIX"/}"/feed.xml)"
+by_category_url="$(url-for "${DIR#"$CONTENT_PREFIX"/}/${by_category_url_part:?}")"
+title_html="$(eval "echo \"\$index_${collection}_title\"" | htmlesc)"
+index_recent_title_html="$(eval "echo \"\$index_recent_${collection}_title\"" | htmlesc)"
+index_category_title_html="$(eval "echo \"\$index_category_${collection}_title\"" | htmlesc)"
+export url_absolute feed_url by_category_url title_html index_recent_title_html \
+ index_category_title_html
+
+
+
+mkdir -p "$DIR"
+{
+ cat src/lib/preamble.html src/lib/index-preamble.html | envsubst
+ find "$DIR"/*.sortdata 2>/dev/null |
+ sort -nr |
+ xargs cat |
+ sed 's|\.md$|.indexentry|' |
+ xargs cat
+ cat src/lib/index-postamble.html src/lib/postamble.html | envsubst
+} > "$FILENAME"
+
+
+CATEGORY_FILENAME="$CONTENT_PREFIX$by_category_url"
+echo "$CATEGORY_FILENAME" > "${FILENAME%.html}.extrahtml"
+
+url_absolute="$(absolute "$by_category_url")"
+title_html="$(eval "echo \"\$index_category_${collection}_title\"" | htmlesc)"
+export url_absolute title_html
+
+
+DIR="$(dirname "$CATEGORY_FILENAME")"
+mkdir -p "$DIR"
+{
+ envsubst < src/lib/preamble.html
+ while read -r category; do
+ feed_url="$(url-for "${DIR#"$CONTENT_PREFIX"/}/feed.$category.xml")"
+ index_recent_title_html="$category"
+ export category feed_url index_recent_title_html
+
+ envsubst < src/lib/category-header.html
+ echo '
- The content for this site is licensed under CC BY-SA 4.0. The code is AGPLv3 or later. Patches welcome.
+ The content for this site is licensed under
+ CC BY-SA 4.0.
+ The code is
+ AGPLv3 or later.
+ Patches welcome.
'
+ < "$DIR/$category.category" \
+ sed 's|\.md$|.categoryentry|' |
+ xargs cat
+ echo '
'
+ done < "$DIR"/index.categories
+ envsubst < src/lib/postamble.html
+} > "$CATEGORY_FILENAME"
diff --git a/v2/src/bin/indexentry b/v2/src/bin/indexentry
new file mode 100755
index 0000000..03bf771
--- /dev/null
+++ b/v2/src/bin/indexentry
@@ -0,0 +1,73 @@
+#!/bin/sh
+set -eu
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ indexentry FILENAME
+ indexentry -h
+ EOF
+}
+
+help() {
+ cat <<-'EOF'
+
+
+ Options:
+ -h, --help show this message
+
+ FILENAME the name of the input .md file
+
+
+ Process FILE, and generate an index collection entry.
+
+
+ Examples:
+
+ Generate the index entry for a TIL:
+
+ $ indexentry src/tils/a-til.md > src/tils/a-til.indexentry
+ EOF
+}
+
+
+for flag in "$@"; do
+ case "$flag" in
+ --)
+ break
+ ;;
+ --help)
+ usage
+ help
+ exit
+ ;;
+ *)
+ ;;
+ esac
+done
+
+while getopts 'h' flag; do
+ case "$flag" in
+ h)
+ usage
+ help
+ exit
+ ;;
+ *)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+. src/lib.sh
+
+FILENAME="${1:-}"
+eval "$(assert_arg "$FILENAME" 'FILENAME')"
+
+
+# shellcheck source=/dev/null
+. "${FILENAME%.md}.conf"
+
+envsubst < src/lib/entry.html
diff --git a/v2/src/bin/makemake b/v2/src/bin/makemake
index 665bb84..20fd6dd 100755
--- a/v2/src/bin/makemake
+++ b/v2/src/bin/makemake
@@ -74,7 +74,8 @@ EXTENSIONS='
'
COLL_EXTENSIONS='
-.sortref
+.categoryentry
+.indexentry
.xmlentry
'
@@ -116,16 +117,20 @@ for lang in $(langs); do
exts | sed "s|^\(.*\)\$|\$($c.$lang\1)|" | varlist "$c.$lang"
mds | sed 's/^\(.*\)\.md$/\1.conf \1.content: \1.md/'
- mds | sed 's/^\(.*\)\.md$/\1.snippets \1.htmlbody \1.html: \1.conf \1.content/'
+ mds | sed 's/^\(.*\)\.md$/\1.categoryentry \1.indexentry \1.html: \1.conf \1.content/'
+ mds | sed 's/^\(.*\)\.md$/\1.snippets \1.htmlbody: \1.html/'
if [ "$c" = 'pages' ]; then
continue
fi
- mds | sed 's/^\(.*\)\.md$/\1.sortref: \1.md/'
- mds | sed 's/^\(.*\)\.md$/\1.xmlentry: \1.html/'
+ mds | sed 's/^\(.*\)\.md$/\1.xmlentry: \1.htmlbody/'
- echo "$CONTENT_PREFIX/$lang/feeds/$c.xml: \$($c.$lang.xmlentry)"
+ echo "$CONTENT_PREFIX/$lang/$c/index.categories: \$($c.$lang.categoryentry)"
+ echo "$CONTENT_PREFIX/$lang/$c/index.html: \$($c.$lang.indexentry) $CONTENT_PREFIX/$lang/$c/index.categories"
+ echo "$CONTENT_PREFIX/$lang/$c/feed.xml: \$($c.$lang.xmlentry) $CONTENT_PREFIX/$lang/$c/index.categories"
+ echo "$CONTENT_PREFIX/$lang/$c/index.extrahtml: $CONTENT_PREFIX/$lang/$c/index.html"
+ echo "$CONTENT_PREFIX/$lang/$c/index.extrafeeds: $CONTENT_PREFIX/$lang/$c/feed.xml"
printf '\n\n'
done
@@ -141,17 +146,33 @@ for lang in $(langs); do
done
collections |
- sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/feeds/\1.xml|" |
+ sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/index.categories|" |
+ varlist "all-generated.$lang.categories"
+
+ collections |
+ sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/index.extrahtml|" |
+ varlist "all-generated.$lang.extrahtml"
+
+ collections |
+ sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/index.extrafeeds|" |
+ varlist "all-generated.$lang.extrafeeds"
+
+ collections |
+ sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/index.html|" |
+ varlist "all-generated.$lang.index"
+
+ collections |
+ sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/feed.xml|" |
varlist "all-generated.$lang.xml"
- extensions '.xml' |
+ extensions '.categories' '.extrahtml' '.extrafeeds' '.index' '.xml' |
sed "s|^\(.*\)\$|\$(all-generated.$lang\1)|" |
varlist "all-generated.$lang"
printf '\n'
done
-for e in $(extensions .xml); do
+for e in $(extensions '.categories' '.extrahtml' '.extrafeeds' '.index' '.xml'); do
langs |
sed "s|^\(.*\)\$|\$(all-generated.\1$e)|" |
varlist "all-generated$e"
diff --git a/v2/src/content/en/pastebins/raku-tuple-type-annotation.md b/v2/src/content/en/pastebins/raku-tuple-type-annotation.md
index 5877470..6c13b39 100644
--- a/v2/src/content/en/pastebins/raku-tuple-type-annotation.md
+++ b/v2/src/content/en/pastebins/raku-tuple-type-annotation.md
@@ -4,6 +4,8 @@ title: Raku tuple type annotation
date: 2019-12-29
+categories: raku programming-languages
+
---
```perl
diff --git a/v2/src/content/en/pastebins/sicp-exercise-3-19.md b/v2/src/content/en/pastebins/sicp-exercise-3-19.md
index 3188dce..32f7aa9 100644
--- a/v2/src/content/en/pastebins/sicp-exercise-3-19.md
+++ b/v2/src/content/en/pastebins/sicp-exercise-3-19.md
@@ -4,6 +4,8 @@ title: SICP exercise 3.19
date: 2021-09-02
+categories: lisp programming-languages
+
---
Some content here, before:
diff --git a/v2/src/content/en/tils/lisp-three-way-conditional.md b/v2/src/content/en/tils/lisp-three-way-conditional.md
index cd7a034..20fbd09 100644
--- a/v2/src/content/en/tils/lisp-three-way-conditional.md
+++ b/v2/src/content/en/tils/lisp-three-way-conditional.md
@@ -6,6 +6,8 @@ date: 2021-04-24 3
update: 2021-08-14
+categories: lisp scheme common-lisp
+
---
A useful macro from Paul Graham's [On Lisp][on-lisp] book:
diff --git a/v2/src/content/favicon.svg b/v2/src/content/favicon.svg
deleted file mode 100644
index ce566b2..0000000
--- a/v2/src/content/favicon.svg
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
diff --git a/v2/src/content/img/alt/atom.en.txt b/v2/src/content/img/alt/atom.en.txt
new file mode 100644
index 0000000..33bc955
--- /dev/null
+++ b/v2/src/content/img/alt/atom.en.txt
@@ -0,0 +1 @@
+three yellow lines representing an Atom feed
diff --git a/v2/src/content/img/alt/atom.pt.txt b/v2/src/content/img/alt/atom.pt.txt
new file mode 100644
index 0000000..33bc955
--- /dev/null
+++ b/v2/src/content/img/alt/atom.pt.txt
@@ -0,0 +1 @@
+three yellow lines representing an Atom feed
diff --git a/v2/src/content/img/alt/envelope.en.txt b/v2/src/content/img/alt/envelope.en.txt
new file mode 100644
index 0000000..8b72080
--- /dev/null
+++ b/v2/src/content/img/alt/envelope.en.txt
@@ -0,0 +1 @@
+an envelope icon representing an email address
diff --git a/v2/src/content/img/alt/envelope.pt.txt b/v2/src/content/img/alt/envelope.pt.txt
new file mode 100644
index 0000000..8b72080
--- /dev/null
+++ b/v2/src/content/img/alt/envelope.pt.txt
@@ -0,0 +1 @@
+an envelope icon representing an email address
diff --git a/v2/src/content/img/alt/favicon.en.txt b/v2/src/content/img/alt/favicon.en.txt
new file mode 100644
index 0000000..add8557
--- /dev/null
+++ b/v2/src/content/img/alt/favicon.en.txt
@@ -0,0 +1 @@
+a crude hand doing a thumbs up
diff --git a/v2/src/content/img/alt/favicon.pt.txt b/v2/src/content/img/alt/favicon.pt.txt
new file mode 100644
index 0000000..add8557
--- /dev/null
+++ b/v2/src/content/img/alt/favicon.pt.txt
@@ -0,0 +1 @@
+a crude hand doing a thumbs up
diff --git a/v2/src/content/img/alt/link.en.txt b/v2/src/content/img/alt/link.en.txt
new file mode 100644
index 0000000..bbf036f
--- /dev/null
+++ b/v2/src/content/img/alt/link.en.txt
@@ -0,0 +1 @@
+two chain rings, representing an anchor to this header
diff --git a/v2/src/content/img/alt/link.pt.txt b/v2/src/content/img/alt/link.pt.txt
new file mode 100644
index 0000000..bbf036f
--- /dev/null
+++ b/v2/src/content/img/alt/link.pt.txt
@@ -0,0 +1 @@
+two chain rings, representing an anchor to this header
diff --git a/v2/src/content/img/alt/linkto.en.txt b/v2/src/content/img/alt/linkto.en.txt
new file mode 100644
index 0000000..a192899
--- /dev/null
+++ b/v2/src/content/img/alt/linkto.en.txt
@@ -0,0 +1 @@
+a drawing of a box with an arrow going outwards, representing an internal link
diff --git a/v2/src/content/img/alt/linkto.pt.txt b/v2/src/content/img/alt/linkto.pt.txt
new file mode 100644
index 0000000..df3bbf7
--- /dev/null
+++ b/v2/src/content/img/alt/linkto.pt.txt
@@ -0,0 +1,2 @@
+a drawing of a box with an arrow going outwards, representing an internal
+link
diff --git a/v2/src/content/img/alt/lock.en.txt b/v2/src/content/img/alt/lock.en.txt
new file mode 100644
index 0000000..b809247
--- /dev/null
+++ b/v2/src/content/img/alt/lock.en.txt
@@ -0,0 +1 @@
+a lock icon representing a GPG public key
diff --git a/v2/src/content/img/alt/lock.pt.txt b/v2/src/content/img/alt/lock.pt.txt
new file mode 100644
index 0000000..b809247
--- /dev/null
+++ b/v2/src/content/img/alt/lock.pt.txt
@@ -0,0 +1 @@
+a lock icon representing a GPG public key
diff --git a/v2/src/content/img/atom.svg b/v2/src/content/img/atom.svg
new file mode 100644
index 0000000..37bace2
--- /dev/null
+++ b/v2/src/content/img/atom.svg
@@ -0,0 +1,5 @@
+
+
diff --git a/v2/src/content/img/favicon.svg b/v2/src/content/img/favicon.svg
new file mode 100644
index 0000000..ce566b2
--- /dev/null
+++ b/v2/src/content/img/favicon.svg
@@ -0,0 +1,62 @@
+
+
diff --git a/v2/src/content/img/linkto.svg b/v2/src/content/img/linkto.svg
new file mode 100644
index 0000000..d4d9fe1
--- /dev/null
+++ b/v2/src/content/img/linkto.svg
@@ -0,0 +1,7 @@
+
+
diff --git a/v2/src/content/pt/pastebins/exercicios-sicp-e-19.md b/v2/src/content/pt/pastebins/exercicios-sicp-e-19.md
index d4db88d..89dacfd 100644
--- a/v2/src/content/pt/pastebins/exercicios-sicp-e-19.md
+++ b/v2/src/content/pt/pastebins/exercicios-sicp-e-19.md
@@ -4,6 +4,8 @@ title: SICP exercise 3.19
date: 2021-09-02
+categories: lisp programming-languages
+
---
Some content here, before:
diff --git a/v2/src/content/security.txt b/v2/src/content/security.txt
deleted file mode 120000
index abdf74b..0000000
--- a/v2/src/content/security.txt
+++ /dev/null
@@ -1 +0,0 @@
-.well-known/security.txt
\ No newline at end of file
diff --git a/v2/src/lib/base.conf b/v2/src/lib/base.conf
index 319d08c..72f70b9 100644
--- a/v2/src/lib/base.conf
+++ b/v2/src/lib/base.conf
@@ -6,4 +6,3 @@ export mailto_uri_prefix="mailto:$list_addr?Subject=Re%3A%20"
export discussions_url_prefix="https://lists.sr.ht/~euandreh/public-inbox?search="
export sourcecode_url_prefix="https://$domain/git/$domain/tree/"
export author='EuAndreh'
-export pubkey_id='81F90EC3CD356060' # FIXME
diff --git a/v2/src/lib/base.en.conf b/v2/src/lib/base.en.conf
index 52aede3..5ced00a 100644
--- a/v2/src/lib/base.en.conf
+++ b/v2/src/lib/base.en.conf
@@ -2,6 +2,32 @@ export date_fmt='%B %-d, %Y'
export site_name="EuAndreh's website"
+export lang='en'
+
+export index_pastebins_title='Pastebins'
+
+export index_recent_pastebins_title='Pastebins listing'
+
+export index_category_pastebins_title='Pastebins by category'
+
+export index by_category_url_part='by-category.html'
+
+export feed_pastebins_title="EuAndreh's pastebins"
+
+export index_tils_title='TIL'
+
+export index_recent_tils_title='TIL listing'
+
+export index_category_tils_title='TIL by category'
+
+export feed_tils_title="EuAndreh's TIL"
+
export about='About'
export about_url_name='about.html'
+
+export homepage_url="$(url-for "$lang/")"
+
+export homepage_url_absolute="$(absolute "$homepage_url")"
+
+export about_url="$(url-for "$lang/$about_url_name")"
diff --git a/v2/src/lib/base.pt.conf b/v2/src/lib/base.pt.conf
index 52aede3..fe03f42 100644
--- a/v2/src/lib/base.pt.conf
+++ b/v2/src/lib/base.pt.conf
@@ -2,6 +2,32 @@ export date_fmt='%B %-d, %Y'
export site_name="EuAndreh's website"
+export lang='pt'
+
+export index_pastebins_title='Pastebins'
+
+export index_recent_pastebins_title='Pastebins listing'
+
+export index_category_pastebins_title='Pastebins by category'
+
+export index by_category_url_part='by-category.html'
+
+export feed_pastebins_title="EuAndreh's pastebins"
+
+export index_tils_title='TIL'
+
+export index_recent_tils_title='TIL listing'
+
+export index_category_tils_title='TIL by category'
+
+export feed_tils_title="EuAndreh's TIL"
+
export about='About'
export about_url_name='about.html'
+
+export homepage_url="$(url-for "$lang/")"
+
+export homepage_url_absolute="$(absolute "$homepage_url")"
+
+export about_url="$(url-for "$lang/$about_url_name")"
diff --git a/v2/src/lib/category-header.html b/v2/src/lib/category-header.html
new file mode 100755
index 0000000..a69b198
--- /dev/null
+++ b/v2/src/lib/category-header.html
@@ -0,0 +1,6 @@
+
+ $index_recent_title_html
+
+
+
+
diff --git a/v2/src/lib/category.html b/v2/src/lib/category.html
new file mode 100644
index 0000000..172829b
--- /dev/null
+++ b/v2/src/lib/category.html
@@ -0,0 +1,3 @@
+
+ $title_html
+
+
+ $index_category_title_html
+
+
+
diff --git a/v2/src/lib/index-preamble.html b/v2/src/lib/index-preamble.html
new file mode 100755
index 0000000..2c17031
--- /dev/null
+++ b/v2/src/lib/index-preamble.html
@@ -0,0 +1,7 @@
+
+ $index_recent_title_html
+
+
+
+
+
diff --git a/v2/src/lib/postamble.html b/v2/src/lib/postamble.html
index 00dc1dc..e55666d 100644
--- a/v2/src/lib/postamble.html
+++ b/v2/src/lib/postamble.html
@@ -5,16 +5,20 @@ $comment_html