aboutsummaryrefslogtreecommitdiff
path: root/v2/src/bin/makemake
diff options
context:
space:
mode:
Diffstat (limited to 'v2/src/bin/makemake')
-rwxr-xr-xv2/src/bin/makemake47
1 files changed, 34 insertions, 13 deletions
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,6 +182,11 @@ 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)|" |
@@ -180,6 +195,11 @@ done
# shellcheck disable=2016
langs |
+ sed 's|^\(.*\)$|$(pages.\1.md)|' |
+ varlist 'pages-mds'
+
+# shellcheck disable=2016
+langs |
sed 's|^\(.*\)$|$(all-generated.\1)|' |
varlist 'all-generated'
@@ -190,4 +210,5 @@ git ls-files src/ |
git ls-files "$CONTENT_PREFIX"/ |
grep -v '\.md$' |
+ grep -v '\.page$' |
varlist 'static-content'