Compare commits
4 Commits
78a259c568
...
d82fc393d1
Author | SHA1 | Date |
---|---|---|
localhost_frssoft | d82fc393d1 | |
localhost_frssoft | 5489ac0104 | |
localhost_frssoft | 030076d6a9 | |
localhost_frssoft | b0fd0ba45b |
|
@ -54,5 +54,6 @@ for i in $(jj -l -i "$basedir"/response.json 'data.#.id'); do
|
|||
echo "=> $raw_id.gmi $title ($published)" | cat - $baseblogdir/index.gmi > $basedir/tmp && mv tmp $baseblogdir/index.gmi
|
||||
fi
|
||||
done
|
||||
#
|
||||
|
||||
$basedir/rss_atom_gen.sh $baseblogdir > $baseblogdir/atom.xml
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
|
||||
atom_xml() {
|
||||
|
||||
cat <<EOF
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>Ледяной автобус в Нифльхейм</title>
|
||||
<link href="$uri" rel="self" />
|
||||
<updated>$(date --iso=seconds)</updated>
|
||||
<author>
|
||||
<name>Лиэс.</name>
|
||||
</author>
|
||||
<id>tag:default-atom-feed</id>
|
||||
EOF
|
||||
|
||||
for i in $1/*.gmi; do
|
||||
if [ -n "$(echo "$i" | grep -Eo 'atom|index')" ]; then continue; fi
|
||||
raw_id=$(echo "$i" | rev | cut -d'/' -f 1 | rev)
|
||||
title=$(head -n 1 $i | tr -d '#')
|
||||
created=$(date -r $i --iso-8601=seconds)
|
||||
updated=$created
|
||||
if [ "$created" = "draft" ]; then continue; fi
|
||||
|
||||
day=$(echo "$created" | sed 's/T.*//')
|
||||
#content=$($MARKDOWN "$f" | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g')
|
||||
|
||||
cat <<EOF
|
||||
<entry>
|
||||
<title>$title</title>
|
||||
<link href="$(echo "$raw_id")"/>
|
||||
<id>tag:$day:$raw_id</id>
|
||||
<published>$created</published>
|
||||
<updated>$updated</updated>
|
||||
</entry>
|
||||
EOF
|
||||
done
|
||||
|
||||
echo '</feed>'
|
||||
}
|
||||
|
||||
uri="pub.phreedom.club/~localhost/Lies_dybr/" atom_xml $1
|
Loading…
Reference in New Issue