blob: 5a9ae5d9e61841eecb2a69fd519ed70a52f22c15 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
#!/bin/sh
set -eu
export LANG=POSIX.UTF-8
normalize() {
xargs realpath --relative-to=. | sort
}
pages() {
find src/pages/*/*.adoc -type f | normalize
}
articles() {
find src/collections/*/*/ -type f -name '*.adoc' | normalize
}
indexes() {
find src/collections/*/index.adoc | normalize
}
categories() {
find src/collections/*/categories.adoc | normalize
}
media() {
find src/content/ \( -type f -and \! -type l \) -and \( \
-name '*.flac' -or \
-name '*.ogg' -or \
-name '*.webm' \
\)
}
tarballs() {
find src/content/ \( -type f -and \! -type l \) -and \( \
-name '*.tar.gz' \
\)
}
extras() {
media
tarballs
}
listings() {
indexes
categories
}
files() {
pages
articles
listings
}
pages | varlist 'pages.adoc'
articles | varlist 'articles.adoc'
categories | varlist 'categories.adoc'
indexes | varlist 'indexes.adoc'
indexes | sed 's|/index\.adoc$|/feed.xml|' | varlist 'feeds.xml'
find src/content/img/ -name '*.svg' | varlist 'images.svg'
media | varlist 'sources.media'
tarballs | varlist 'sources.tarballs'
extras | varlist 'sources.extras'
{
files | sed 's/^\(.*\)\.adoc$/\1.html/'
files | sed 's/^\(.*\)\.adoc$/\1.snippets/'
indexes | sed 's|^\(.*\)/index\.adoc$|\1/categories.xml|'
indexes | sed 's|^\(.*\)/index\.adoc$|\1/feed.xml|'
} | sed 's/^\(.*\)$/\1.gz:\t\1/'
printf '\n'
files | sed 's/^\(.*\)\.adoc$/\1.htmlbody\t\1.snippets\t\1.conf:\t\1.adoc/'
files | sed 's/^\(.*\)\.adoc$/\1.html:\t\1.conf\t\1.htmlbody/'
printf '\n'
files | sed 's/^\(.*\)\.adoc$/\1.updatedat-check:\t\1.conf/'
files | sed 's/^\(.*\)\.adoc$/\1.links-internal-check:\t\1.links/'
files | sed 's/^\(.*\)\.adoc$/\1.caslinks:\t\1.links/'
printf '\n'
articles | sed 's/^\(.*\)\.adoc$/\1.feedentry:\t\1.conf\t\1.htmlbody/'
articles | sed 's/^\(.*\)\.adoc$/\1.sortdata:\t\1.conf/'
articles | sed 's/^\(.*\)\.adoc$/\1.categorydata:\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.conf/'
listings | sed 's/^\(.*\)\.adoc$/\1.html:\t\1.htmlheader\t\1.htmlfooter/'
listings | sed 's/^\(.*\)\.adoc$/\1.html:\t\1.htmllisting\t\1.htmlbody/'
printf '\n'
media | sed 's/\(.*\)$/\1.torrent:\t\1/'
printf '\n'
for colllink in src/collections/*; do
c="$(printf '%s' "$colllink" | normalize)"
printf '\n\n'
name="$(basename "$c")"
find "$c"/*/ -type f -name '*.adoc' | varlist "articles.$name.adoc"
art=articles # so things fit in 80 columns
echo "$art.$name.sortdata = \$($art.$name.adoc:.adoc=.sortdata)"
echo "$art.$name.indexentry = \$($art.$name.adoc:.adoc=.indexentry)"
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 $(articles.%s.sortdata) > $@\n\n' "'%s\n'" "$name"
listings='
feed.xml
index.htmllisting
categories.htmllisting
categories.txt
'
for lst in $listings; do
printf '%s/%s:\t%s/sortdata.txt\n' "$c" "$lst" "$c"
printf '%s/%s:\t$(articles.%s.sortdata)\n' "$c" "$lst" "$name"
done
printf '%s/index.htmllisting\t' "$c"
printf '%s/categories.htmllisting:\t' "$c"
printf '$(articles.%s.indexentry)\n' "$name"
printf '%s/categories.txt:\t' "$c"
printf '$(articles.%s.categorydata)\n' "$name"
printf '%s/categories.txt\t' "$c"
printf '%s/feed.xml:\t' "$c"
printf '$(articles.%s.feedentry)\n' "$name"
printf '%s/categories.htmllisting\t' "$c"
printf '%s/categories.xml:\t' "$c"
printf '%s/categories.txt\n' "$c"
done
|