all repos — site @ b55eecbaefac6f2e320a41cd5458146643f777ce

source for my site, found at icyphox.sh

Add plaintext.sh

Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Fri, 24 Jan 2020 18:33:59 +0530
commit

b55eecbaefac6f2e320a41cd5458146643f777ce

parent

010e3fcb11d149c607f23c202dbfddc6cb50c22c

2 files changed, 17 insertions(+), 1 deletions(-)

jump to
A bin/plaintext.sh

@@ -0,0 +1,16 @@

+#!/bin/sh + +# from the pure sh bible; see: +# https://github.com/dylanaraps/pure-sh-bible#get-the-base-name-of-a-file-path +basename() { + dir=${1%${1##*[!/]}} + dir=${dir##*/} + dir=${dir%"$2"} + base="${dir:-/}" +} + +for p in pages/blog/*.md; do + basename "$p" + [ "$base" != "_index.md" ] && + cp "$p" "build/blog/${base%.*}.txt" +done
M config.pyconfig.py

@@ -19,4 +19,4 @@ <img class="footimgs" alt="xxiivv webring" src="/static/webring.svg">

</a> """ template = 'text.html' # default is index.html -post_build = ['./bin/rss.py'] +post_build = ['./bin/rss.py', './bin/plaintext.sh']