aboutsummaryrefslogtreecommitdiff
path: root/generate
diff options
context:
space:
mode:
Diffstat (limited to 'generate')
-rwxr-xr-xgenerate12
1 files changed, 12 insertions, 0 deletions
diff --git a/generate b/generate
index 1bea8d3..6bb22fb 100755
--- a/generate
+++ b/generate
@@ -36,6 +36,8 @@ base_template < school.template.html |
base_template_link 'favicon.png' |
base_template_link 'style.css' > school.html
+cp rss.template.xml rss.xml
+
# Generate blog posts
for post_path in "$blog_path"/*.md
do
@@ -53,6 +55,16 @@ do
sed -i "/<!-- BLOGINDEX -->/ a\
<li><a href=\"$post_dst_path\">$title</a></li>" index.html
+ post_date=$(date '+%a, %d %b %Y %H:%M:%S %z' -d "$(stat -c '%w' "$post_path")")
+ sed -i "/<!-- ITEM -->/ a\
+ <item> \
+ <title>$title</title> \
+ <pubDate>$post_date</pubDate> \
+ <guid>https://cacharle.xyz/$post_dst_path</guid> \
+ <link>https://cacharle.xyz/$post_dst_path</link> \
+ <description>Open this entry in your browser to see the content</description> \
+ </item>" rss.xml
+
echo "Generated post at $post_dst_path"
done