From 6c2cbb02ac4b16ee7b4c37de50403ce604868ec0 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 8 Apr 2023 16:20:00 -0300 Subject: v2: i18n of the collection name, "article" collection in root --- v2/src/bin/makemake | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'v2/src/bin/makemake') diff --git a/v2/src/bin/makemake b/v2/src/bin/makemake index 20fd6dd..06041b0 100755 --- a/v2/src/bin/makemake +++ b/v2/src/bin/makemake @@ -98,14 +98,17 @@ for lang in $(langs); do for c in pages $(collections); do if [ "$c" = 'pages' ]; then filter="$page_ext_filter" - dir="$CONTENT_PREFIX/$lang" + src='page' + coll_path='' else filter='^$' - dir="$CONTENT_PREFIX/$lang/$c" + src='md' + coll_path="$(coll2path "$lang" "$c")" fi mds() { - find "$dir"/*.md 2>/dev/null + git ls-files "$CONTENT_PREFIX/$lang/$coll_path"*."$src" | + sed 's|\.page$|.md|' } exts() { @@ -120,17 +123,19 @@ for lang in $(langs); do mds | sed 's/^\(.*\)\.md$/\1.categoryentry \1.indexentry \1.html: \1.conf \1.content/' mds | sed 's/^\(.*\)\.md$/\1.snippets \1.htmlbody: \1.html/' if [ "$c" = 'pages' ]; then + mds | sed 's|\.md$|\.page|' | varlist "pages.$lang.page" + mds | sed "s|^\(.*\).md$|\1.md: \1.page|" continue fi mds | sed 's/^\(.*\)\.md$/\1.xmlentry: \1.htmlbody/' - echo "$CONTENT_PREFIX/$lang/$c/index.categories: \$($c.$lang.categoryentry)" - echo "$CONTENT_PREFIX/$lang/$c/index.html: \$($c.$lang.indexentry) $CONTENT_PREFIX/$lang/$c/index.categories" - echo "$CONTENT_PREFIX/$lang/$c/feed.xml: \$($c.$lang.xmlentry) $CONTENT_PREFIX/$lang/$c/index.categories" + echo "$CONTENT_PREFIX/$lang/${coll_path}index.categories: \$($c.$lang.categoryentry)" + echo "$CONTENT_PREFIX/$lang/${coll_path}index.html: \$($c.$lang.indexentry) $CONTENT_PREFIX/$lang/${coll_path}index.categories" + echo "$CONTENT_PREFIX/$lang/${coll_path}feed.xml: \$($c.$lang.xmlentry) $CONTENT_PREFIX/$lang/${coll_path}index.categories" - echo "$CONTENT_PREFIX/$lang/$c/index.extrahtml: $CONTENT_PREFIX/$lang/$c/index.html" - echo "$CONTENT_PREFIX/$lang/$c/index.extrafeeds: $CONTENT_PREFIX/$lang/$c/feed.xml" + echo "$CONTENT_PREFIX/$lang/${coll_path}index.extrahtml: $CONTENT_PREFIX/$lang/${coll_path}index.html" + echo "$CONTENT_PREFIX/$lang/${coll_path}index.extrafeeds: $CONTENT_PREFIX/$lang/${coll_path}feed.xml" printf '\n\n' done @@ -146,23 +151,28 @@ for lang in $(langs); do done collections | - sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/index.categories|" | + xargs -I% coll2path "$lang" % | + sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1index.categories|" | varlist "all-generated.$lang.categories" collections | - sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/index.extrahtml|" | + xargs -I% coll2path "$lang" % | + sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1index.extrahtml|" | varlist "all-generated.$lang.extrahtml" collections | - sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/index.extrafeeds|" | + xargs -I% coll2path "$lang" % | + sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1index.extrafeeds|" | varlist "all-generated.$lang.extrafeeds" collections | - sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/index.html|" | + xargs -I% coll2path "$lang" % | + sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1index.html|" | varlist "all-generated.$lang.index" collections | - sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1/feed.xml|" | + xargs -I% coll2path "$lang" % | + sed "s|^\(.*\)\$|$CONTENT_PREFIX/$lang/\1feed.xml|" | varlist "all-generated.$lang.xml" extensions '.categories' '.extrahtml' '.extrafeeds' '.index' '.xml' | @@ -172,12 +182,22 @@ for lang in $(langs); do printf '\n' done +git ls-files | + grep '\.page' | + sed "s|^$CONTENT_PREFIX\(.*\)\.page|\1.md|" > "$CONTENT_PREFIX"/.gitignore + + for e in $(extensions '.categories' '.extrahtml' '.extrafeeds' '.index' '.xml'); do langs | sed "s|^\(.*\)\$|\$(all-generated.\1$e)|" | varlist "all-generated$e" done +# shellcheck disable=2016 +langs | + sed 's|^\(.*\)$|$(pages.\1.md)|' | + varlist 'pages-mds' + # shellcheck disable=2016 langs | sed 's|^\(.*\)$|$(all-generated.\1)|' | @@ -190,4 +210,5 @@ git ls-files src/ | git ls-files "$CONTENT_PREFIX"/ | grep -v '\.md$' | + grep -v '\.page$' | varlist 'static-content' -- cgit v1.2.3