summaryrefslogtreecommitdiffhomepage
path: root/www/Makefile
blob: 80b9d47ceb21e67614b3bf38399a38665e177221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
.ONESHELL:
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))

# build html files for public/
build:
	@input_dir=~/log/posts \
	output_dir=/srv/http \
	assets_dir=$(ROOT_DIR)assets \
	template_dir=$(ROOT_DIR)templates \
	$(ROOT_DIR)scripts/build.sh

# Migrage frontmatter from '---' to HTML comment '<!-- -->'
frontmatter:
	find content -type f -name '*.md' | xargs sed -i ':frontmatter { 1s/^---/<!--/; 1!s/^---/-->/; 1!b}; /^---/ {1b frontmatter}'