diff options
author | EuAndreh <eu@euandre.org> | 2025-05-01 18:21:33 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-05-01 18:21:33 -0300 |
commit | d8bf25cb07a7aa88840f1df81b0a022bdf683f4f (patch) | |
tree | fdc08d5a88ddb3afa7379b49f4a60cbd913591dd /mkdeps.sh | |
parent | mkdeps.sh: Fixup indentation (diff) | |
download | euandre.org-d8bf25cb07a7aa88840f1df81b0a022bdf683f4f.tar.gz euandre.org-d8bf25cb07a7aa88840f1df81b0a022bdf683f4f.tar.xz |
Support multiple names for "categories" file
Diffstat (limited to 'mkdeps.sh')
-rwxr-xr-x | mkdeps.sh | 35 |
1 files changed, 18 insertions, 17 deletions
@@ -9,23 +9,23 @@ normalize() { } pages() { - find src/pages/*/*.adoc -type f | normalize + find src/pages/*/*.adoc -type f | normalize } articles() { - find src/collections/*/*/*/ -type f -name '*.adoc' | normalize + find src/collections/*/*/*/ -type f -name '*.adoc' | normalize } slides() { - find src/slides/*/*/ -type f -name '*.adoc' | normalize + find src/slides/*/*/ -type f -name '*.adoc' | normalize } indexes() { - find src/collections/*/*/index.adoc | normalize + find src/collections/*/*/index.adoc | normalize } categories() { - find src/collections/*/*/categories.name | normalize + grep -l '^:type: categories$' src/collections/*/*/*.adoc | normalize } media() { @@ -81,7 +81,6 @@ cat po/po4a.cfg | files | sed 's/^\(.*\)\.adoc$/\1.html/' files | sed 's/^\(.*\)\.adoc$/\1.snippets/' slides | sed 's/^\(.*\)\.adoc$/\1.pdf/' - indexes | sed 's|^\(.*\)/index\.adoc$|\1/categories.xml|' indexes | sed 's|^\(.*\)/index\.adoc$|\1/feed.xml|' } | sed 's/^\(.*\)$/\1.gz:\t\1/' printf '\n' @@ -120,6 +119,7 @@ collectionentries() { colllink="$2" lang="$(basename "$langlink")" c="$(printf '%s' "$colllink" | normalize)" + plural="$(cat src/names/categories/"$lang".txt)" printf '\n\n' name="$(basename "$c")" @@ -130,35 +130,36 @@ collectionentries() { echo "$art.$name.feedentry = \$($art.$name.adoc:.adoc=.feedentry)" echo "$art.$name.categorydata = \$($art.$name.adoc:.adoc=.categorydata)" - printf '%s/sortdata.txt:\tdeps.mk\n' "$c" printf '\tprintf %s $(%s.%s.sortdata) > $@\n\n' "'%s\n'" "$art" "$name" - listings=' + listings=" feed.xml index.htmllisting - categories.htmllisting - categories.txt - ' + $plural.htmllisting + $plural.txt + " for lst in $listings; do printf '%s/%s:\t%s/sortdata.txt\n' "$c" "$lst" "$c" printf '%s/%s:\t$(%s.%s.sortdata)\n' "$c" "$lst" "$art" "$name" done printf '%s/index.htmllisting\t' "$c" - printf '%s/categories.htmllisting:\t' "$c" + printf '%s/%s.htmllisting:\t' "$c" "$plural" printf '$(%s.%s.indexentry)\n' "$art" "$name" - printf '%s/categories.txt:\t' "$c" + printf '%s/%s.txt:\t' "$c" "$plural" printf '$(%s.%s.categorydata)\n' "$art" "$name" - printf '%s/categories.txt\t' "$c" + printf '%s/%s.txt\t' "$c" "$plural" printf '%s/feed.xml:\t' "$c" printf '$(%s.%s.feedentry)\n' "$art" "$name" - printf '%s/categories.htmllisting\t' "$c" - printf '%s/categories.xml:\t' "$c" - printf '%s/categories.txt\n' "$c" + printf '%s/%s.htmllisting\t' "$c" "$plural" + printf '%s/%s.xml:\t' "$c" "$plural" + printf '%s/%s.txt\n' "$c" "$plural" + + printf '%s/%s.xml.gz:\t%s/%s.xml\n' "$c" "$plural" "$c" "$plural" } |