commit: 5df2190f2033d34d2b17d15858bf3d86f9ea3987
parent 86279c6ecd376d7a03db15727a57f124ac08673e
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 7 Apr 2023 19:20:53 +0200
new_article.sh: Move to feed.atom.in with XInclude
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/new_article.sh b/new_article.sh
@@ -14,20 +14,20 @@ case $# in
;;
esac
-file_url="/articles/$(echo \"$file\" | jq -r '@uri')"
+file_url="articles/$(echo \"$file\" | jq -r '@uri')"
timestamp="$(date -u +%FT%TZ)"
ht=" "
WORKDIR="$(dirname $0)"
-if grep -q "/articles/${file}" feed.atom
+if grep -q "/articles/${file}" 'feed.atom.in'
then
- echo 'Error: article already in feed.atom'
+ echo 'Error: article already in feed.atom.in'
exit 1
else
- ed "${WORKDIR}/feed.atom" <<-EOF
+ ed "${WORKDIR}/feed.atom.in" <<-EOF
/new.sh: new articles here/
a
-<!--#include file="/articles/${file}.xml"-->
+<xi:include href="${file_url}.xml"/>
.
w
q
@@ -37,8 +37,8 @@ fi
cat >"${WORKDIR}/articles/${file}.xml" <<-EOF
<entry>
<title>${title}</title>
-<link rel="alternate" type="text/html" href="${file_url}"/>
-<id>https://hacktivis.me${file_url}</id>
+<link rel="alternate" type="text/html" href="/${file_url}"/>
+<id>https://hacktivis.me/${file_url}</id>
<published>${timestamp}</published>
<updated>${timestamp}</updated>
<!--
@@ -47,7 +47,7 @@ cat >"${WORKDIR}/articles/${file}.xml" <<-EOF
-->
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class="h-entry">
-<a href="${file_url}"><h1>${title}</h1></a>
+<a href="/${file_url}"><h1>${title}</h1></a>
<!-- Article content goes here -->