Commit e761bdf7 authored by PoroCYon's avatar PoroCYon

makefile hackery

parent 6a1eebf7
......@@ -37,6 +37,8 @@ OUTPUT_FILES:=$(patsubst src/%.md, out/%.html, $(INPUT_FILES))
DATERFC3339:=$(shell LC_TIME='C' date -u '+%FT%TZ')
DATERFC822:=$(shell LC_TIME='C' date -u '+%c')
TPL_SHARED=tpl/after.html tpl/before.html tpl/header.html
%/:
mkdir -p "$@"
......@@ -51,24 +53,24 @@ out/feed/%.xml: obj/%.xml.pre obj/%.list.xml tpl/%.xml.post
@if ! [ -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
cat $^ > "$@"
out/blog.html: src/blog.md obj/postlist.html
out/blog.html: src/blog.md obj/postlist.html $(TPL_SHARED) tpl/template-blog.html
$(PANDOC) $(PDFLAGS) -f $(PDMARKDOWN) --template=tpl/template-blog.html -A obj/postlist.html -t html "$<" -o "$@"
out/%.html: src/%.md
out/%.html: src/%.md obj/postlist.html $(TPL_SHARED) tpl/template.html
@if ! [ -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
$(PANDOC) $(PDFLAGS) -f $(PDMARKDOWN) --template=tpl/template.html -t html "$<" -o "$@"
out/stc/%.css: sty/%.scss out/stc/
$(SCSSC) -t compact -M "$<" "$@"
all: obj/ $(wildcard stc/*) $(wildcard tpl/*.html) \
all: obj/ out/ $(wildcard stc/*) \
out/stc/style-dark.css out/stc/style-light.css \
out/feed/rss.xml out/feed/atom.xml \
$(OUTPUT_FILES)
@cp -vr stc/ out/
clean:
@rm -rvf out/
@rm -rvf out/ obj/
ningau.sh:
@echo "This is a remote update mechanism. Implementation is an exercise for the reader."
......@@ -81,7 +83,7 @@ test: all
blogpost:
./mkblogpost.sh
.PHONY: default all clean distclean install test
.PHONY: default all clean install test blogpost
.PRECIOUS: obj/ out/ out/stc/
.PRECIOUS: obj/ obj/atom.list.xml obj/rss.list.xml out/ out/stc/
---
title: Hello world!
blog-comment-link: hello-world
blog-date: 2017-12-13
...
# Hello world!
......
---
title: RSS Test
blog-comment-link: rss-test
blog-date: 2017-12-13
...
# RSS Test
......
---
title: "Writeup: 512b rms intro: making of"
blog-comment-link: writeup-512b-rms-intro-making-of
blog-date: 2017-12-14
...
# Writeup: 512b rms intro: making of
......
......@@ -55,6 +55,10 @@ $for(sidebar-links)$
$endfor$
</td>
<td class="middle">
$if(blog-date)$
$blog-date$
<hr /><br />
$endif$
$body$
$if(blog-comment-link)$
<br /><br /><hr />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment