tUse extended regex to generate feed (more compact) - monochromatic - monochromatic blog: http://blog.z3bra.org
HTML git clone git://z3bra.org/monochromatic
DIR Log
DIR Files
DIR Refs
---
DIR commit 52f9e7a3868847549636ab448882097e1bdba81c
DIR parent e04e47b0028d0ee67da301cfbed951c2e862f37f
HTML Author: Willy Goiffon <dev@z3bra.org>
Date: Mon, 23 Dec 2019 16:04:34 +0100
Use extended regex to generate feed (more compact)
Diffstat:
M Makefile | 2 +-
M feed.sed | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
---
DIR diff --git a/Makefile b/Makefile
t@@ -13,7 +13,7 @@ index.txt:
$(FEEDS): index.txt
mkdir -p `dirname $@`
- sed -f ./feed.sed < index.txt > $@
+ sed -Ef ./feed.sed < index.txt > $@
.txt.html:
$(MD) $< | cat $(HEADER) - $(FOOTER) > $@
DIR diff --git a/feed.sed b/feed.sed
t@@ -1,19 +1,19 @@
-#!/bin/sed -f
+#!/bin/sed -Ef
# RSS feed header
1i\
<?xml version='1.0'?>\
<rss version='2.0' xmlns:atom="http://www.w3.org/2005/Atom">\
- <channel>\
- <title>Monochromatic</title>\
- <description>z3bra, the stripes appart</description>\
- <link>https://blog.z3bra.org</link>\
- <atom:link href="https://blog.z3bra.org/rss/feed.xml" rel="self" type="application/rss+xml" />
+<channel>\
+<title>Monochromatic</title>\
+<description>z3bra, the stripes appart</description>\
+<link>https://blog.z3bra.org</link>\
+<atom:link href="https://blog.z3bra.org/rss/feed.xml" rel="self" type="application/rss+xml" />
# Append all entries to the feed, one item per post
-s^\* \([x0-9a-f]*\) - \[\(.*\)\](\(.*\)) <item><title>\2</title><guid isPermaLink=\"false\">\1</guid><link>https://blog.z3bra.org\3</link></item>
+s@^. ([x0-9a-f]+).*\[(.+)\]\((.+)\)@<item><title>\2</title><link>https://blog.z3bra.org\3</link><guid isPermaLink=\"false\">\1</guid></item>@
# close tags
$a\
- </channel>\
+</channel>\
</rss>