diff options
Diffstat (limited to '')
| -rwxr-xr-x | mkdeps.sh | 55 |
1 files changed, 47 insertions, 8 deletions
@@ -4,27 +4,66 @@ set -eu export LANG=POSIX.UTF-8 -articles() { - find src/content/*/ -type f -name '*.adoc' | sort +normalize() { + xargs realpath | + awk -vPWD="$PWD/" '{ print substr($0, length(PWD) + 1) }' | + sort } pages() { - find src/content/*.adoc -type f | sort + find src/pages/*/*.adoc -type f | normalize +} + +articles() { + find src/collections/*/*/ -type f -name '*.adoc' | normalize +} + +listings() { + find src/collections/*/index.adoc | normalize } files() { - articles pages + articles + listings } -articles | varlist 'articles.adoc' -pages | varlist 'pages.adoc' -find src/content/img/ -name '*.svg' | varlist 'images.svg' +pages | varlist 'pages.adoc' +articles | varlist 'articles.adoc' +listings | varlist 'listings.adoc' +listings | sed 's|/index\.adoc$|/feed.xml|' | varlist 'feeds.xml' +find src/content/img/ -name '*.svg' | varlist 'images.svg' files | sed 's/^\(.*\)\.adoc$/\1.htmlbody\t\1.snippets\t\1.conf:\t\1.adoc/' -files | sed 's/^\(.*\)\.adoc$/\1.snippets:\t\1.adoc/' files | sed 's/^\(.*\)\.adoc$/\1.html:\t\1.conf\t\1.htmlbody/' +printf '\n' + articles | sed 's/^\(.*\)\.adoc$/\1.feedentry:\t\1.conf\t\1.htmlbody/' articles | sed 's/^\(.*\)\.adoc$/\1.sortdata:\t\1.conf/' +printf '\n' + +listings | sed 's/^\(.*\)\.adoc$/\1.htmlheader\t\1.htmlfooter:\t\1.conf/' +listings | sed 's/^\(.*\)\.adoc$/\1.htmllisting:\t\1.htmldeps/' +listings | sed 's/^\(.*\)\.adoc$/\1.html:\t\1.htmlheader\t\1.htmlfooter/' +listings | sed 's/^\(.*\)\.adoc$/\1.html:\t\1.htmllisting\t\1.htmlbody/' + +for colllink in src/collections/*; do + c="$(printf '%s' "$colllink" | normalize)" + + printf '\n' + printf '\n' + name="$(basename "$c")" + find "$c"/*/ -type f -name '*.adoc' | varlist "articles.$name.adoc" + printf \ + 'articles.%s.sortdata = $(articles.%s.adoc:.adoc=.sortdata)\n' \ + "$name" "$name" + + + printf '%s/index.htmldeps: $(articles.%s.sortdata)\n' "$c" "$name" + printf '\tfind $(articles.%s.sortdata) > $@\n\n' "$name" + printf '%s/feed.xmldeps: $(articles.%s.sortdata)\n' "$c" "$name" + printf '\tfind $(articles.%s.sortdata) > $@\n\n' "$name" + printf '%s/feed.xml:\t%s/feed.xmldeps\n\n' "$c" "$c" +done |
