Make site curlable
This commit is contained in:
parent
b97e19b707
commit
b63d2ebeb2
16 changed files with 291 additions and 7 deletions
26
Makefile
26
Makefile
|
|
@ -1,5 +1,6 @@
|
|||
SHELL = /bin/sh
|
||||
INSTALLDIR := ./public_html/eh/eh/eh/eh-eh/
|
||||
INSTALLDIR_HTML := ./public_html/eh/eh/eh/eh-eh/
|
||||
INSTALLDIR_ANSI := ./public_ansi/
|
||||
|
||||
# The name of the stylesheet. This needs to be copied to any directory containing html files that use it.
|
||||
style := style.css
|
||||
|
|
@ -15,18 +16,20 @@ list_template := pandoc/meta-json-template.txt
|
|||
article_list := articles.json
|
||||
|
||||
# article targets
|
||||
articles := $(patsubst %.md,%.html,$(wildcard articles/*.md))
|
||||
articles_html := $(patsubst %.md,%.html,$(wildcard articles/*.md))
|
||||
articles_ansi := $(patsubst %.md,%,$(wildcard articles/*.md))
|
||||
|
||||
all: index.html about.html
|
||||
all: index.html index about.html about
|
||||
|
||||
install:
|
||||
cp -r index.html about.html shark.js shark.png dvd-logo.png $(articles) $(style) $(images) $(INSTALLDIR); \
|
||||
cp -r index.html about.html shark.js shark.png $(articles_html) $(style) $(images) $(INSTALLDIR_HTML); \
|
||||
cp -r index about $(articles_ansi) $(INSTALLDIR_ANSI);
|
||||
|
||||
clean:
|
||||
echo '{"articles": []}' > $(article_list); \
|
||||
rm index.html about.html $(articles);
|
||||
rm index.html about.html $(articles_html);
|
||||
|
||||
$(articles): %.html: %.md
|
||||
$(articles_html): %.html: %.md
|
||||
jq 'del(.articles[] | select(.filename == "$(notdir $@)"))' $(article_list) > articles.json.tmp; \
|
||||
mv ./articles.json.tmp $(article_list); \
|
||||
|
||||
|
|
@ -38,9 +41,18 @@ $(articles): %.html: %.md
|
|||
jq '.articles += [$(shell pandoc $< --template $(list_template) | jq '. += {"filename": "$(notdir $@)"}' )]' $(article_list) > articles.json.tmp; \
|
||||
mv ./articles.json.tmp $(article_list); \
|
||||
|
||||
index.html: index.md $(articles)
|
||||
$(articles_ansi): %: %.md
|
||||
pandoc $< --to ansi --output $@
|
||||
|
||||
index.html: index.md $(articles_html)
|
||||
# Build index.html with metadata injected from articles_list
|
||||
pandoc $< --template $(template) --include-after-body shark.js --css $(style) --metadata-file $(article_list) --highlight-style zenburn --mathml --toc --output $@; \
|
||||
|
||||
index: index.md $(articles_ansi)
|
||||
pandoc $< --to ansi --output $@
|
||||
|
||||
about.html: about.md
|
||||
pandoc $< --template $(template) --css $(style) --highlight-style zenburn --mathml --toc --output $@
|
||||
|
||||
about: about.md
|
||||
pandoc $< --to ansi --output $@
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue