diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-12-06 18:26:32 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-12-06 18:26:32 +0100 |
| commit | b0524c148b80e4f07bceb74a0f320722221d5bfa (patch) | |
| tree | b85857d61ce258102c60271f571fda05edc5258a /generate | |
| parent | 0c3e5a542e3a0e37f5c41b7dead75e62fce324b7 (diff) | |
| download | cacharle.xyz-b0524c148b80e4f07bceb74a0f320722221d5bfa.tar.gz cacharle.xyz-b0524c148b80e4f07bceb74a0f320722221d5bfa.tar.bz2 cacharle.xyz-b0524c148b80e4f07bceb74a0f320722221d5bfa.zip | |
Added rss generator
Diffstat (limited to 'generate')
| -rwxr-xr-x | generate | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |
