aboutsummaryrefslogtreecommitdiff
path: root/v2/src/bin/index
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-04-10 16:18:01 -0300
committerEuAndreh <eu@euandre.org>2023-04-10 16:18:01 -0300
commit4b9cddca7f0f75e321319c79e94b3af3ce37e5ef (patch)
tree3cbbaba20deadebb9169c6c2a1ea65d984da05ae /v2/src/bin/index
parentv2: <link /> to translated version in <head /> (diff)
downloadeuandre.org-4b9cddca7f0f75e321319c79e94b3af3ce37e5ef.tar.gz
euandre.org-4b9cddca7f0f75e321319c79e94b3af3ce37e5ef.tar.xz
v2: <link /> to collection feed inside <head>
Diffstat (limited to '')
-rwxr-xr-xv2/src/bin/index9
1 files changed, 7 insertions, 2 deletions
diff --git a/v2/src/bin/index b/v2/src/bin/index
index 36abd2e..6212544 100755
--- a/v2/src/bin/index
+++ b/v2/src/bin/index
@@ -85,11 +85,16 @@ index_category_title_html="$(eval "echo \"\$index_category_${collection}_title\"
export url_absolute feed_url by_category_url title_html index_recent_title_html \
index_category_title_html
+feed_title="$(eval "echo \"\$feed_${collection}_title\"")"
+collection_head_html="$(printf ' <link rel="alternate" type="application/atom+xml" href="%s" title="%s" />' \
+ "$feed_url" \
+ "$(htmlesc "$feed_title")")"
+
translations_head_html="$(langs |
awk -v lang="${lang:?}" -v coll="$collection" '$0 != lang {
"coll2path " $0 " " coll | getline coll_path
"url-for " $0 "/" coll_path | getline url
- printf " <link rel=\"alternate\" type=\"text/html\" href=\"%s\" hreflang=\"%s\" />\n",
+ printf " <link rel=\"alternate\" type=\"text/html\" href=\"%s\" hreflang=\"%s\" />\n",
url, $0
}'
)"
@@ -103,7 +108,7 @@ translations_body_html="$(cat <<-EOF
</ul>
EOF
)"
-export translations_head_html translations_body_html
+export collection_head_html translations_head_html translations_body_html