summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2020-12-31 18:04:32 +0100
committerVolpeon <git@volpeon.ink>2020-12-31 18:04:32 +0100
commit59bfd90c13f1f95a3443c3a167d49af4175a7c26 (patch)
treec69cdb24d707a4cf95e9d6956d9f2712805e96c8
parentDesign: Less vertical padding for containers on mobile (diff)
downloadvolpeon.ink-59bfd90c13f1f95a3443c3a167d49af4175a7c26.tar.gz
volpeon.ink-59bfd90c13f1f95a3443c3a167d49af4175a7c26.tar.bz2
volpeon.ink-59bfd90c13f1f95a3443c3a167d49af4175a7c26.zip
Add last_update metadata to pages
-rwxr-xr-xscripts/build_content.sh17
-rw-r--r--templates/feed.xml2
2 files changed, 17 insertions, 2 deletions
diff --git a/scripts/build_content.sh b/scripts/build_content.sh
index a57feed..17532f5 100755
--- a/scripts/build_content.sh
+++ b/scripts/build_content.sh
@@ -122,6 +122,17 @@ get_subpages_meta() {
122 date_rfc3339=$(date -d "$date" --rfc-3339=seconds | sed 's/ /T/') 122 date_rfc3339=$(date -d "$date" --rfc-3339=seconds | sed 's/ /T/')
123 fi 123 fi
124 124
125 last_update=$(echo "$metadata" | jq -r .last_update)
126 last_update_rfc3339=""
127
128 if [ "$last_update" != "" ]; then
129 last_update=$date
130 fi
131
132 if [ "$last_update" != "" ]; then
133 last_update_rfc3339=$(date -d "$last_update" --rfc-3339=seconds | sed 's/ /T/')
134 fi
135
125 category=$(echo "$metadata" | jq -r .category) 136 category=$(echo "$metadata" | jq -r .category)
126 category_name="" 137 category_name=""
127 138
@@ -140,6 +151,10 @@ get_subpages_meta() {
140 yyyy_mm_dd: \"$date\", \ 151 yyyy_mm_dd: \"$date\", \
141 rfc3339: \"$date_rfc3339\" \ 152 rfc3339: \"$date_rfc3339\" \
142 }, \ 153 }, \
154 last_update: { \
155 yyyy_mm_dd: \"$last_update\", \
156 rfc3339: \"$last_update_rfc3339\" \
157 }, \
143 url: { \ 158 url: { \
144 rel: \"$url_rel\", \ 159 rel: \"$url_rel\", \
145 abs: \"$url_abs\", \ 160 abs: \"$url_abs\", \
@@ -217,7 +232,7 @@ handle () {
217 if [ "$create_feed" = "true" ]; then 232 if [ "$create_feed" = "true" ]; then
218 feed_url_abs="$(get_url_abs "$1" "xml")" 233 feed_url_abs="$(get_url_abs "$1" "xml")"
219 feed_url_full="${SITE%/}$feed_url_abs" 234 feed_url_full="${SITE%/}$feed_url_abs"
220 last_update=$(echo "$added_metadata" | jq -r ".pages.all[0].date") 235 last_update=$(echo "$added_metadata" | jq -r ".pages.all[0].last_update")
221 236
222 added_metadata=$(echo "$added_metadata" | jq ". + { \ 237 added_metadata=$(echo "$added_metadata" | jq ". + { \
223 feed: { \ 238 feed: { \
diff --git a/templates/feed.xml b/templates/feed.xml
index d760b04..0b828f6 100644
--- a/templates/feed.xml
+++ b/templates/feed.xml
@@ -41,7 +41,7 @@
41 $endif$ 41 $endif$
42 <link href="$it.url.full$"/> 42 <link href="$it.url.full$"/>
43 <published>$it.date.rfc3339$</published> 43 <published>$it.date.rfc3339$</published>
44 <updated>$it.date.rfc3339$</updated> 44 <updated>$it.last_update.rfc3339$</updated>
45 $-- <content>$it.plain$</content> 45 $-- <content>$it.plain$</content>
46 </entry> 46 </entry>
47 $endif$ 47 $endif$