diff options
-rwxr-xr-x | scripts/build_content.sh | 23 | ||||
-rw-r--r-- | templates/feed.xml | 2 |
2 files changed, 14 insertions, 11 deletions
diff --git a/scripts/build_content.sh b/scripts/build_content.sh index 17532f5..4e1b396 100755 --- a/scripts/build_content.sh +++ b/scripts/build_content.sh | |||
@@ -85,12 +85,20 @@ get_subpages_meta() { | |||
85 | child_pages=() | 85 | child_pages=() |
86 | 86 | ||
87 | if [ -d "$basedir" ]; then | 87 | if [ -d "$basedir" ]; then |
88 | mapfile -d $'\0' child_pages < <(find $basedir/ \ | 88 | mapfile -d $'\0' child_pages_1 < <(find $basedir/ \ |
89 | -type f \ | 89 | -type f \ |
90 | -name "*.md" \ | 90 | -name "*.md" ! -name "index.md" \ |
91 | ! -wholename "$basedir/index.md" \ | 91 | -maxdepth 1 \ |
92 | -print0) | ||
93 | |||
94 | mapfile -d $'\0' child_pages_2 < <(find $basedir/ \ | ||
95 | -type f \ | ||
96 | -name "index.md" \ | ||
97 | -mindepth 2 \ | ||
92 | -maxdepth 2 \ | 98 | -maxdepth 2 \ |
93 | -print0) | 99 | -print0) |
100 | |||
101 | child_pages=("${child_pages_1[@]}" "${child_pages_2[@]}") | ||
94 | fi | 102 | fi |
95 | 103 | ||
96 | pages=$(echo "{}" | jq ". + { \ | 104 | pages=$(echo "{}" | jq ". + { \ |
@@ -107,7 +115,7 @@ get_subpages_meta() { | |||
107 | #echo -e "\033[0;90m[////////]\033[0m - $file" | 115 | #echo -e "\033[0;90m[////////]\033[0m - $file" |
108 | 116 | ||
109 | metadata=$(get_metadata "$file") | 117 | metadata=$(get_metadata "$file") |
110 | # content=$(get_content "$file") | 118 | content=$(get_content "$file") |
111 | 119 | ||
112 | section=$(get_section "$file") | 120 | section=$(get_section "$file") |
113 | 121 | ||
@@ -140,13 +148,8 @@ get_subpages_meta() { | |||
140 | category_name=$(echo "$CATEGORIES" | jq -r .$section.$category) | 148 | category_name=$(echo "$CATEGORIES" | jq -r .$section.$category) |
141 | fi | 149 | fi |
142 | 150 | ||
143 | # metadata=$(echo "$metadata" | jq ". + { \ | ||
144 | # content: { \ | ||
145 | # plain: \"$(echo "$content" | sed -z 's/\\/\\\\/g;s/\n/\\n/g;s/"/\"/g')\", \ | ||
146 | # }, \ | ||
147 | # }") | ||
148 | |||
149 | metadata=$(echo "$metadata" | jq ". + { \ | 151 | metadata=$(echo "$metadata" | jq ". + { \ |
152 | content: \"$(echo "$content" | sed -z 's/\\/\\\\/g;s/\n/\\n/g;s/"/\"/g')\", \ | ||
150 | date: { \ | 153 | date: { \ |
151 | yyyy_mm_dd: \"$date\", \ | 154 | yyyy_mm_dd: \"$date\", \ |
152 | rfc3339: \"$date_rfc3339\" \ | 155 | rfc3339: \"$date_rfc3339\" \ |
diff --git a/templates/feed.xml b/templates/feed.xml index 0b828f6..4cc2c17 100644 --- a/templates/feed.xml +++ b/templates/feed.xml | |||
@@ -42,7 +42,7 @@ | |||
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.last_update.rfc3339$</updated> | 44 | <updated>$it.last_update.rfc3339$</updated> |
45 | $-- <content>$it.plain$</content> | 45 | <content type="html"><![CDATA[$it.content$]]></content> |
46 | </entry> | 46 | </entry> |
47 | $endif$ | 47 | $endif$ |
48 | $endfor$ | 48 | $endfor$ |