fsfi

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 7f32b98e6234e97479c1489c9c7802e61f5f0b1f
parent 6b6d196beaef9997cbb1f23cb08709c21fa9d41d
Author: rsiddharth <s@ricketyspace.net>
Date:   Fri, 17 May 2019 22:02:18 -0400

bin/feed: Update process.

* bin/feed (process): Sort entries.
(entry): Return id, entry string.

Diffstat:
bin/feed | 16+++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/bin/feed b/bin/feed @@ -161,14 +161,17 @@ def entry(sec, f): c = read(f.path) s = slug(f.path) + t = time(c) + id = t + ':' + s + e = template('entry') - e = e.replace(E_PH['id'], s, 1) + e = e.replace(E_PH['id'], id, 1) e = e.replace(E_PH['title'], title(c), 1) e = e.replace(E_PH['link'], elink(sec, s), 1) - e = e.replace(E_PH['updated'], time(c), 1) + e = e.replace(E_PH['updated'], t, 1) e = e.replace(E_PH['content'], content(c), 1) - return e + return id, e def esort(esd): @@ -192,9 +195,12 @@ def feed(sec, es): def process(sec): - es = '' + esd = {} for f in files(sec): - es += entry(sec, f) + id, e = entry(sec, f) + esd[id] = e + + es = ''.join(esort(esd)) write('/'.join(['_build', sec, 'feed.atom']), feed(sec, es))