Replace rss feed with atom
This commit is contained in:
parent
2fa212a36f
commit
043338995f
|
@ -13,18 +13,17 @@ output_rss() {
|
||||||
add_header() {
|
add_header() {
|
||||||
output '<h1>Blog index</h1><table id="linklist">'
|
output '<h1>Blog index</h1><table id="linklist">'
|
||||||
output_rss '<?xml version="1.0" encoding="UTF-8" ?>
|
output_rss '<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<rss version="2.0">
|
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
|
||||||
<channel>
|
<author><name>kageru</name></author>
|
||||||
<title>kageru’s blog</title>'
|
<title>kageru’s blog</title>'
|
||||||
output_rss " <link>$blog_domain</link>
|
output_rss " <link href=\"$blog_domain\" rel=\"self\" type=\"application/atom+xml\"/>
|
||||||
<description>kageru’s blog</description>"
|
<description>kageru’s blog</description>"
|
||||||
}
|
}
|
||||||
|
|
||||||
add_footer() {
|
add_footer() {
|
||||||
html_entry "legacy" "before 2020" "Older posts"
|
html_entry "legacy" "before 2020" "Older posts"
|
||||||
output '</table>'
|
output '</table>'
|
||||||
output_rss '</channel>
|
output_rss '</feed>'
|
||||||
</rss>'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html_entry() {
|
html_entry() {
|
||||||
|
@ -37,11 +36,18 @@ html_entry() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rss_entry() {
|
rss_entry() {
|
||||||
output_rss " <item>
|
# The content is the output minus the first line
|
||||||
|
# (which would otherwise be a redundant title in most rss readers)
|
||||||
|
# and with escaped html.
|
||||||
|
# The sed expression is stolen from https://stackoverflow.com/questions/12873682/12873723#12873723
|
||||||
|
output_rss " <entry>
|
||||||
<title>$1</title>
|
<title>$1</title>
|
||||||
<link>$blog_domain$2</link>
|
<link>$blog_domain$2</link>
|
||||||
<description>$1</description>
|
<link href=\"$blog_domain$2\" type=\"text/html\" title=\"$1\"/>
|
||||||
</item>"
|
<content type=\"html\" xml:base=\"$blog_domain$2\">
|
||||||
|
$(tail -n+2 "$2" | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g')
|
||||||
|
</content>
|
||||||
|
</entry>"
|
||||||
}
|
}
|
||||||
|
|
||||||
create_entry() {
|
create_entry() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user