forked from kageru/mdb
simplify handling of date for rss feed and add custom date format for blog-index
This commit is contained in:
parent
af773b4de2
commit
ce337cf373
|
@ -22,13 +22,13 @@ add_header() {
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
|
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
|
||||||
<author><name>Lucy</name></author>
|
<author><name>Lucy</name></author>
|
||||||
<title type="text">Lucys blog</title>'
|
<title type="text">Lucys blog</title>'
|
||||||
output_rss " <updated>$(date --rfc-3339=seconds | sed 's/ /T/')</updated>
|
output_rss " <updated>$(date --iso-8601=seconds)</updated>
|
||||||
<id>https://lucy.moe/rss.xml</id>
|
<id>https://lucy.moe/rss.xml</id>
|
||||||
<link href=\"https://lucy.moe/rss.xml\" rel=\"self\" type=\"application/atom+xml\"/>"
|
<link href=\"https://lucy.moe/rss.xml\" rel=\"self\" type=\"application/atom+xml\"/>"
|
||||||
}
|
}
|
||||||
|
|
||||||
add_footer() {
|
add_footer() {
|
||||||
html_entry "https://asagi.moe" "before July 2020" "Old site" "de/en"
|
html_entry "https://asagi.moe" "before July 2020" "Old site"
|
||||||
output '</table>'
|
output '</table>'
|
||||||
output_rss '</feed>'
|
output_rss '</feed>'
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,8 @@ rss_entry() {
|
||||||
# The sed expression is stolen from https://stackoverflow.com/questions/12873682/12873723#12873723
|
# The sed expression is stolen from https://stackoverflow.com/questions/12873682/12873723#12873723
|
||||||
output_rss " <entry>
|
output_rss " <entry>
|
||||||
<title type=\"text\">$1</title>
|
<title type=\"text\">$1</title>
|
||||||
<published>$(date --rfc-3339=seconds -d $4 | sed 's/ /T/')</published>
|
<published>$(date --iso-8601=seconds -d $4)</published>
|
||||||
<updated>$(date --rfc-3339=seconds -r $3 | sed 's/ /T/')</updated>
|
<updated>$(date --iso-8601=seconds -r $3)</updated>
|
||||||
<id>$blog_domain$2</id>
|
<id>$blog_domain$2</id>
|
||||||
<link href=\"$blog_domain$2\" type=\"text/html\" title=\"$1\"/>
|
<link href=\"$blog_domain$2\" type=\"text/html\" title=\"$1\"/>
|
||||||
<summary type=\"html\">
|
<summary type=\"html\">
|
||||||
|
@ -72,7 +72,8 @@ create_entry() {
|
||||||
# then add it to the index
|
# then add it to the index
|
||||||
title=$(grep -h '<title>' "dist/$outpath" | sed 's/<title>//g;s/<\/title>//g')
|
title=$(grep -h '<title>' "dist/$outpath" | sed 's/<title>//g;s/<\/title>//g')
|
||||||
created=$(grep -h '^date: ' "$path" | sed 's/date: //g')
|
created=$(grep -h '^date: ' "$path" | sed 's/date: //g')
|
||||||
html_entry "$outpath" "$created" "$title"
|
created_date=$(date +%x --date="$created")
|
||||||
|
html_entry "$outpath" "$created_date" "$title"
|
||||||
rss_entry "$title" "$outpath" $path $created
|
rss_entry "$title" "$outpath" $path $created
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user