-
Notifications
You must be signed in to change notification settings - Fork 0
/
2023.49.mak
219 lines (178 loc) · 6.23 KB
/
2023.49.mak
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#
# A rethink on my site build makefile
#
#SUNDAY = $(shell reldate sunday)
#SATURDAY = $(shell reldate saturday)
#VOL_NO = $(shell date +%Y.%W)
SUNDAY = 2023-12-10
SATURDAY = 2023-12-16
VOL_NO = 2023.49
YEAR = 2023
ifneq ($(vol),)
VOL_NO=$(vol)
endif
ifneq ($(start),)
SUNDAY = $(start)
endif
ifneq ($(end),)
SATURDAY = $(end)
endif
PROJECT = Antenna
section_names = socal_north pacific mid_central tech_likely columns weather writing games libraries parks
md_files = $(addsuffix .md,$(section_names))
html_files = $(addsuffix .html,$(section_names))
build: markdown html archives index.html about.html search.html README.html CITATION.cff
website: markdown html archives index.html about.html search.html README.html
harvest: *.skim
*.skim: *.txt
*.txt: .FORCE
skimmer $@
#
# Helper rules to retrieve and debug specific feed lists
#
socal_north: .FORCE
skimmer socal_north.txt
pacific: .FORCE
skimmer pacific.txt
mid_central: .FORCE
skimmer mid_central.txt
tech_likely: .FORCE
skimmer tech_likely.txt
columns: .FORCE
skimmer columns.txt
weather: .FORCE
skimmer weather.txt
writing: .FORCE
skimmer writing.txt
games: .FORCE
skimmer games.txt
libraries: .FORCE
skimmer libraries.txt
parks: .FORCE
skimmer parks.txt
markdown: $(md_files)
$(md_files): .FORCE
sqlite3 $(basename $@).skim "UPDATE items SET status = 'read'"
sqlite3 $(basename $@).skim "UPDATE items SET status = 'saved' WHERE published >= '$(SUNDAY)' AND published <= '$(SATURDAY)'"
skim2md -title "$(shell echo $(basename $@) | sed -E 's/_/ /g') $(VOL_NO)" \
-frontmatter -pocket $(basename $@).skim \
>$@
mkdir -p $(YEAR)
cp -v "$@" "$(YEAR)/$(basename $@)_$(VOL_NO).md"
html: front_page.tmpl $(html_files)
%.html: %.md front_page.tmpl
pandoc -f markdown -t html5 \
--lua-filter=links-to-html.lua \
--metadata urls_file="$(basename $@).txt" \
--metadata mid_central_page="mid_central.html" \
--metadata pacific_page="pacific.html" \
--metadata socal_north_page="socal_north.html" \
--metadata tech_likely_page="tech_likely.html" \
--metadata libraries_page="libraries.html" \
--metadata games_page="games.html" \
--metadata parks_page="parks.html" \
--metadata columns_page="columns.html" \
--metadata weather_page="weather.html" \
--template front_page.tmpl \
$< \
>$@
archives: mk_archives.bash archives.tmpl
./mk_archives.bash
cd $(YEAR) && make
git add $(YEAR)
pagefind: .FORCE
pagefind \
--verbose \
--force-language en \
--site .
git add pagefind
clean: .FORCE
-rm mid_central.md 2>/dev/null
-rm mid_central.html 2>/dev/null
-rm tech_likely.md 2>/dev/null
-rm tech_likely.html 2>/dev/null
-rm socal_north.md 2>/dev/null
-rm socal_north.html 2>/dev/null
-rm weather.md 2>/dev/null
-rm weather.html 2>/dev/null
-rm pacific.md 2>/dev/null
-rm pacific.html 2>/dev/null
cd $(YEAR) && make clean
CITATION.cff: .FORCE
@cat codemeta.json | sed -E 's/"@context"/"at__context"/g;s/"@type"/"at__type"/g;s/"@id"/"at__id"/g' >_codemeta.json
@echo '' | pandoc --metadata title="Cite $(PROJECT)" --metadata-file=_codemeta.json --template=codemeta-cff.tmpl >CITATION.cff
about.html: about.md
pandoc --metadata title="About $(PROJECT)" \
--lua-filter=links-to-html.lua \
--metadata mid_central_page="mid_central.html" \
--metadata pacific_page="pacific.html" \
--metadata socal_north_page="socal_north.html" \
--metadata tech_likely_page="tech_likely.html" \
--metadata columns_page="columns.html" \
--metadata libraries_page="libraries.html" \
--metadata games_page="games.html" \
--metadata parks_page="parks.html" \
--metadata weather_page="weather.html" \
--template front_page.tmpl \
about.md >about.html
about.md: .FORCE
@cat codemeta.json | sed -E 's/"@context"/"at__context"/g;s/"@type"/"at__type"/g;s/"@id"/"at__id"/g' >_codemeta.json
@echo "" | pandoc --metadata title="About $(PROJECT)" \
--metadata-file=_codemeta.json \
--template codemeta-about.tmpl >about.md #2>/dev/null;
@if [ -f _codemeta.json ]; then rm _codemeta.json; fi
index.html: .FORCE
@echo '' | pandoc --metadata title="The $(PROJECT)" \
--lua-filter=links-to-html.lua \
--metadata mid_central_page="mid_central.html" \
--metadata pacific_page="pacific.html" \
--metadata socal_north_page="socal_north.html" \
--metadata tech_likely_page="tech_likely.html" \
--metadata columns_page="columns.html" \
--metadata libraries_page="libraries.html" \
--metadata games_page="games.html" \
--metadata parks_page="parks.html" \
--metadata weather_page="weather.html" \
--template front_page.tmpl \
index.md >index.html
search.html: .FORCE
@echo '' | pandoc --metadata title="$(PROJECT) Search" \
--lua-filter=links-to-html.lua \
--metadata mid_central_page="mid_central.html" \
--metadata pacific_page="pacific.html" \
--metadata socal_north_page="socal_north.html" \
--metadata tech_likely_page="tech_likely.html" \
--metadata columns_page="columns.html" \
--metadata libraries_page="libraries.html" \
--metadata games_page="games.html" \
--metadata parks_page="parks.html" \
--metadata weather_page="weather.html" \
--template front_page.tmpl \
search.md >search.html
README.html: .FORCE
@echo '' | pandoc --metadata title="Read about $(PROJECT)" \
--lua-filter=links-to-html.lua \
--metadata mid_central_page="mid_central.html" \
--metadata pacific_page="pacific.html" \
--metadata socal_north_page="socal_north.html" \
--metadata tech_likely_page="tech_likely.html" \
--metadata columns_page="columns.html" \
--metadata libraries_page="libraries.html" \
--metadata games_page="games.html" \
--metadata parks_page="parks.html" \
--metadata parks_page="parks.html" \
--metadata weather_page="weather.html" \
--template front_page.tmpl \
README.md >README.html
status:
git status
save:
@if [ "$(msg)" != "" ]; then git commit -am "$(msg)"; else git commit -am "Quick Save"; fi
git push origin $(BRANCH)
refresh:
git fetch origin
git pull origin $(BRANCH)
publish: .FORCE
@if [ "$(msg)" != "" ]; then git commit -am "$(msg)"; else git commit -am "Publish Site"; fi
git push origin main
.FORCE: