summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2020-12-30 14:04:18 +0100
committerVolpeon <git@volpeon.ink>2020-12-30 14:04:18 +0100
commitec4ebdaf7c720a339252521e6f1032876fcb3683 (patch)
tree027c7273be6047c08d04c0afe960045b491cfb42
parentFixed subtemplate selection in base template (diff)
downloadvolpeon.ink-ec4ebdaf7c720a339252521e6f1032876fcb3683.tar.gz
volpeon.ink-ec4ebdaf7c720a339252521e6f1032876fcb3683.tar.bz2
volpeon.ink-ec4ebdaf7c720a339252521e6f1032876fcb3683.zip
Store list of feeds in metadata file
-rw-r--r--metadata/metadata.yaml4
-rwxr-xr-xscripts/build_content.sh9
-rw-r--r--templates/base.html9
3 files changed, 14 insertions, 8 deletions
diff --git a/metadata/metadata.yaml b/metadata/metadata.yaml
index 7d30a2a..c060e79 100644
--- a/metadata/metadata.yaml
+++ b/metadata/metadata.yaml
@@ -13,3 +13,7 @@ menus:
13 - id: blog 13 - id: blog
14 label: Blog 14 label: Blog
15 url: /blog/ 15 url: /blog/
16
17feeds:
18 - title: Blog
19 url: /blog/index.xml
diff --git a/scripts/build_content.sh b/scripts/build_content.sh
index e57cfed..6250fe9 100755
--- a/scripts/build_content.sh
+++ b/scripts/build_content.sh
@@ -213,7 +213,6 @@ handle () {
213 create_feed=$(echo "$metadata" | jq -r ".create_feed") 213 create_feed=$(echo "$metadata" | jq -r ".create_feed")
214 214
215 if [ "$create_feed" = "true" ]; then 215 if [ "$create_feed" = "true" ]; then
216 feed_target_file="${target_file%.html}.xml"
217 feed_url_abs="$(target_url_abs "$1" "xml")" 216 feed_url_abs="$(target_url_abs "$1" "xml")"
218 feed_url_full="${SITE%/}$feed_url_abs" 217 feed_url_full="${SITE%/}$feed_url_abs"
219 last_update=$(echo "$metadata" | jq -r ".pages.all[0].date") 218 last_update=$(echo "$metadata" | jq -r ".pages.all[0].date")
@@ -227,21 +226,21 @@ handle () {
227 } \ 226 } \
228 } \ 227 } \
229 }") 228 }")
229 fi
230 230
231 echo "$metadata" > "$meta_file" 231 echo "$metadata" > "$meta_file"
232 232
233 if [ "$create_feed" = "true" ]; then
233 pandoc "$1" \ 234 pandoc "$1" \
234 -f markdown \ 235 -f markdown \
235 -t html5 \ 236 -t html5 \
236 --template "${TEMPLATES_DIR}feed.xml" \ 237 --template "${TEMPLATES_DIR}feed.xml" \
237 -o "$feed_target_file" \ 238 -o "${target_file%.html}.xml" \
238 --metadata-file metadata/metadata.yaml \ 239 --metadata-file metadata/metadata.yaml \
239 --metadata-file "$meta_file" \ 240 --metadata-file "$meta_file" \
240 $FILTERS 241 $FILTERS
241 fi 242 fi
242 243
243 echo "$metadata" > "$meta_file"
244
245 pandoc "$1" \ 244 pandoc "$1" \
246 -f markdown \ 245 -f markdown \
247 -t html5 \ 246 -t html5 \
diff --git a/templates/base.html b/templates/base.html
index e11ed5d..0856b47 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -15,9 +15,12 @@
15 $if(keywords)$ 15 $if(keywords)$
16 <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" /> 16 <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
17 $endif$ 17 $endif$
18 $if(feed.url.abs)$ 18 $-- $if(feed.url.abs)$
19 <link href="$feed.url.abs$" type="application/atom+xml" rel="alternate" title="$if(is_home)$$else$$title$ – $endif$$site.title$" /> 19 $-- <link href="$feed.url.abs$" type="application/atom+xml" rel="alternate" title="$if(is_home)$$else$$title$ – $endif$$site.title$" />
20 $endif$ 20 $-- $endif$
21 $for(feeds)$
22 <link href="$it.url$" type="application/atom+xml" rel="alternate" title="$it.title$ – $site.title$" />
23 $endfor$
21 <title>$if(is_home)$$else$$title$ – $endif$$site.title$</title> 24 <title>$if(is_home)$$else$$title$ – $endif$$site.title$</title>
22 <link rel="stylesheet" href="/style.css" /> 25 <link rel="stylesheet" href="/style.css" />
23 $if(section.id)$ 26 $if(section.id)$