Skip to content

Instantly share code, notes, and snippets.

@markandrus
Last active January 5, 2023 08:02
Show Gist options
  • Save markandrus/d5116bc621ca641acd33 to your computer and use it in GitHub Desktop.
Save markandrus/d5116bc621ca641acd33 to your computer and use it in GitHub Desktop.
Makefile to convert a directory of Markdown sources to HTML
SRC_MD_FILES=$(shell find src -name \*.md)
MD_FILES=$(SRC_MD_FILES:src/%=%)
HTML_FILES=$(MD_FILES:.md=.html)
BUILD_HTML_FILES=$(HTML_FILES:%=build/%)
all: $(BUILD_HTML_FILES)
build/%.html: src/%.md
mkdir -p $$(dirname $@)
pandoc -o $@ $?
clean:
rm -rf build
.PHONY: clean
@travula
Copy link

travula commented Feb 12, 2018

@markandrus
Is there a way to generate a sitemap.html ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment