2023-02-19-01
This commit is contained in:
parent
591eb28388
commit
e655aecce1
@ -1,15 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -ex;mkdir -p blah;cd blah;sed '1,/^exit 0$/d'<../"$0"|python -c "import sys
|
||||
set -ex
|
||||
mkdir -p blah
|
||||
cd blah
|
||||
sed '1,/^exit 0$/d'<../"$0" | python -c "import sys
|
||||
for day in sys.stdin.read().split('\n\n\n'):
|
||||
if '<!DOCTYPE html>' in day: prefix=day;continue
|
||||
elif day.split('\n')[0][:4] == '<!--': suffix=day;continue
|
||||
with open(day.split('\n')[0]+'.html', 'x') as g:
|
||||
g.write(prefix+day+'\n'+suffix)";for f in *.html
|
||||
do #nt worry :)
|
||||
test -z "$last" || sed -i "s,__NAVIGATION__,$nav<A HREF=\"$f\">\></A></P>," \
|
||||
"$last";nav="<P>";test -z "$last"||nav="$nav<A HREF=\"$last\">\<</A>"
|
||||
nav="$nav<A HREF=\"index.html\">^</A>";last="$f";done
|
||||
sed -i "s,__NAVIGATION__,$nav</P>," "$last"
|
||||
with open(day.split('\n')[0],'w') as f: f.write(day)"
|
||||
sed -i 1d *efix; sed -i 1d *ffix
|
||||
for f in ????-??-??; do #nt worry :)
|
||||
sed '1i<!DOCTYPE html>'<$f|sed -e '1r 0000prefix' -e '$r 0000suffix'>$f.html
|
||||
rm $f; f=$f.html; test -n "$last" && sed -i \
|
||||
"s,__NAVIGATION__,$nav<A HREF=\"$f\">\></A><BR />," "$last" \
|
||||
&& nav="<A HREF=\"$last\">\<</A>"; nav="$nav<A HREF=\"index.html\">^</A>"
|
||||
last="$f"; done
|
||||
sed -i "s,__NAVIGATION__,$nav<BR />," "$last"; rm 0*
|
||||
ls *.html|sed 's/\..*//g'|tee feed.xml|sed 's_.*_<A HREF="/blah/&.html">&</A>_'\
|
||||
| sort -r |>index.html sed -e "1i\
|
||||
<!DOCTYPE html><HTML><HEAD><TITLE>blah</TITLE></HEAD>\
|
||||
@ -26,7 +29,8 @@ sed -i \
|
||||
<lastBuildDate>$(date)</lastBuildDate>" \
|
||||
-e '$a</channel></rss>' feed.xml
|
||||
exit 0
|
||||
<!DOCTYPE html><HEAD><TITLE>blah</TITLE></HEAD><BODY><PRE>
|
||||
0000prefix
|
||||
<HEAD><TITLE>blah</TITLE></HEAD><BODY><PRE>
|
||||
THE WRITER MUST EAT -> patreon.com/trn1ty <-
|
||||
|
||||
blah!
|
||||
@ -41,7 +45,7 @@ ideas-
|
||||
__NAVIGATION__
|
||||
|
||||
|
||||
<!-- insert legal threat or something -->
|
||||
0000suffix
|
||||
</PRE></BODY></HTML>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user