diff options
Diffstat (limited to '')
-rwxr-xr-x | v2/src/bin/conf | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/v2/src/bin/conf b/v2/src/bin/conf index 8345591..5717039 100755 --- a/v2/src/bin/conf +++ b/v2/src/bin/conf @@ -92,6 +92,27 @@ done < "$FILENAME" | tee -a "$FILENAME".tmp rm -f "$FILENAME".tmp +if [ -z "${layout:-}" ]; then + if [ "$(dirname "$(dirname "$FILENAME")")" = "$CONTENT_PREFIX" ]; then + layout=page + else + layout=post + collection="$(basename "$(dirname "$FILENAME")")" + export collection + printf 'export collection="%s"\n' "$collection" + + custom_layout="$(echo "$LAYOUTS" | grep . | + awk -v coll="$collection" '$1 == coll { print $2 }' + )" + if [ -n "$custom_layout" ]; then + layout="$custom_layout" + fi + fi + export layout + printf 'export layout="%s"\n' "$layout" +fi + + lang="$(lang-for "$FILENAME")" export lang printf 'export lang="%s"\n' "$lang" |