diff options
author | Volpeon <git@volpeon.ink> | 2020-12-31 08:39:31 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2020-12-31 08:39:31 +0100 |
commit | 6ea9f97e666cb3712b1060731c302ed9fd5cf7b8 (patch) | |
tree | b10c690ec159c34aee74bc36a02bf9fff8655253 | |
parent | Don't use local Iosevka to see subsetting errors (diff) | |
download | volpeon.ink-6ea9f97e666cb3712b1060731c302ed9fd5cf7b8.tar.gz volpeon.ink-6ea9f97e666cb3712b1060731c302ed9fd5cf7b8.tar.bz2 volpeon.ink-6ea9f97e666cb3712b1060731c302ed9fd5cf7b8.zip |
Don't include page's own metadata in added metadata
-rwxr-xr-x | scripts/build_content.sh | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/scripts/build_content.sh b/scripts/build_content.sh index 72e0956..26c936d 100755 --- a/scripts/build_content.sh +++ b/scripts/build_content.sh | |||
@@ -183,9 +183,9 @@ handle () { | |||
183 | 183 | ||
184 | echo -e "\033[0;90m[COMPILE ]\033[0m Getting metadata" | 184 | echo -e "\033[0;90m[COMPILE ]\033[0m Getting metadata" |
185 | 185 | ||
186 | metadata=$(get_metadata "$1") | 186 | included_metadata=$(get_metadata "$1") |
187 | 187 | ||
188 | create_feed=$(echo "$metadata" | jq -r ".create_feed") | 188 | create_feed=$(echo "$included_metadata" | jq -r ".create_feed") |
189 | 189 | ||
190 | url_abs=$(get_url_abs "$1" "html") | 190 | url_abs=$(get_url_abs "$1" "html") |
191 | url_full="${SITE%/}$url_abs" | 191 | url_full="${SITE%/}$url_abs" |
@@ -197,10 +197,7 @@ handle () { | |||
197 | is_home=true | 197 | is_home=true |
198 | fi | 198 | fi |
199 | 199 | ||
200 | metadata=$(echo "[ \ | 200 | added_metadata=$(echo "$(get_subpages_meta "$1")" | jq ". + { \ |
201 | $metadata, \ | ||
202 | $(get_subpages_meta "$1") \ | ||
203 | ]" | jq ".[0] + .[1] + { \ | ||
204 | url: { \ | 201 | url: { \ |
205 | abs: \"$url_abs\", \ | 202 | abs: \"$url_abs\", \ |
206 | full: \"$url_full\" \ | 203 | full: \"$url_full\" \ |
@@ -215,9 +212,9 @@ handle () { | |||
215 | if [ "$create_feed" = "true" ]; then | 212 | if [ "$create_feed" = "true" ]; then |
216 | feed_url_abs="$(get_url_abs "$1" "xml")" | 213 | feed_url_abs="$(get_url_abs "$1" "xml")" |
217 | feed_url_full="${SITE%/}$feed_url_abs" | 214 | feed_url_full="${SITE%/}$feed_url_abs" |
218 | last_update=$(echo "$metadata" | jq -r ".pages.all[0].date") | 215 | last_update=$(echo "$added_metadata" | jq -r ".pages.all[0].date") |
219 | 216 | ||
220 | metadata=$(echo "$metadata" | jq ". + { \ | 217 | added_metadata=$(echo "$added_metadata" | jq ". + { \ |
221 | feed: { \ | 218 | feed: { \ |
222 | last_update: $last_update, \ | 219 | last_update: $last_update, \ |
223 | url: { \ | 220 | url: { \ |
@@ -228,7 +225,7 @@ handle () { | |||
228 | }") | 225 | }") |
229 | fi | 226 | fi |
230 | 227 | ||
231 | echo "$metadata" > "$meta_file" | 228 | echo "$added_metadata" > "$meta_file" |
232 | 229 | ||
233 | if [ "$create_feed" = "true" ]; then | 230 | if [ "$create_feed" = "true" ]; then |
234 | echo -e "\033[0;90m[COMPILE ]\033[0m Creating feed" | 231 | echo -e "\033[0;90m[COMPILE ]\033[0m Creating feed" |