builddir = build

pandocflags = -M wf-embed-base=https://git.lain.faith/haskal/writeups/raw/branch/main/ -M wf-link-base=https://git.lain.faith/haskal/writeups/src/branch/main/ --filter writefreely-validate --wrap=none --strip-comments

postid = temp

rule pandoc
    command = pandoc $pandocflags -o $out $in
    description = pandoc $out

rule upload
    command = writefreely-cli $postid $in
    description = upload $postid

build $builddir/post-full.md: pandoc post.md
build upload: upload $builddir/post-full.md
build build: phony $builddir/post-full.md
