diff options
author | delta <darkussdelta@gmail.com> | 2025-09-18 23:00:28 +0200 |
---|---|---|
committer | delta <darkussdelta@gmail.com> | 2025-09-18 23:00:28 +0200 |
commit | 8675aa17bc308361b390c2e02ad409935f5b0e17 (patch) | |
tree | bf41130095b4fca0cbfb2957bf045ee2aa5283dd /.zs/rss | |
parent | 088a18410e43a209a4864bccad5ddb89a7ee1d5d (diff) |
add rss feed
Diffstat (limited to '.zs/rss')
-rwxr-xr-x | .zs/rss | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +#!/bin/sh + +for f in ./blog/*.md ; do + d="$(zs var "$f" date)" + if [ ! -z $d ] ; then + timestamp="$(date --date "$(echo "$d" | awk -F- '{print $3"-"$2"-"$1}')" +%s)" + url="$(zs var "$f" url)" + title="$(zs var "$f" title)" + desc="$(zs var "$f" description)" + echo $timestamp \ + "<item>" \ + "<title>$title</title>" \ + "<link>http://darkuss.twoexem.com/$url</link>" \ + "<description>$desc</description>" \ + "<pubDate>$(date --date @$timestamp -R)</pubDate>" \ + "<guid>http://darkuss.twoexem.com/$url</guid>" \ + "</item>" + fi +done | sort -r -n | cut -d' ' -f2- |