aboutsummaryrefslogtreecommitdiff
path: root/post-process.sh
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-04-15 16:01:26 +1000
committerYuchen Pei <hi@ypei.me>2022-04-15 16:01:26 +1000
commit8a20b4a8c0cb280ef8bd98a68f101696a97fb015 (patch)
tree9d36bc94e43dafdc9eb2c52c71f7adbcc2dca7eb /post-process.sh
parent50dcde434e76909a0495b3deb38ac0a56c8e89a6 (diff)
Adding comments
Diffstat (limited to 'post-process.sh')
-rwxr-xr-xpost-process.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/post-process.sh b/post-process.sh
index 1056d7d..81a216b 100755
--- a/post-process.sh
+++ b/post-process.sh
@@ -1,19 +1,20 @@
-# This file is released into the public domain.
-
#!/bin/bash
+# This file is released into the public domain.
# clean up generated sitemap files.
rm pages/{micro,}blog.org
-# fix absolute links mislabelled as file:// links
-for post in $(ls site/posts); do
- sed -i 's/src="file:\/\//src="/g' site/posts/$post
- sed -i 's/href="file:\/\//href="/g' site/posts/$post
+for post in site/posts/*.html; do
+ # fix absolute links mislabelled as file:// links
+ sed -i 's/src="file:\/\//src="/g' "$post"
+ sed -i 's/href="file:\/\//href="/g' "$post"
+ # add comments link
+ sed -Ei 's/(<span class="subtitle">)(.*)(<\/span>)/\1\2 | <a href="#isso-thread">Comments<\/a>\3/' "$post"
done
-for page in $(ls site); do
- sed -i 's/src="file:\/\//src="/g' site/$page
- sed -i 's/href="file:\/\//href="/g' site/$page
+for page in site/*.html; do
+ sed -i 's/src="file:\/\//src="/g' "$page"
+ sed -i 's/href="file:\/\//href="/g' "$page"
done
# fix email address.