diff options
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | .htaccess | 4 | ||||
-rw-r--r-- | Makefile | 23 | ||||
-rw-r--r-- | include/footer.html | 2 | ||||
-rw-r--r-- | include/header.html | 10 |
5 files changed, 46 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f315458 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# Swap and backup files +.*.sw* +.sw* +*~ + +# Rendered files +policies/*.html diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..cc03570 --- /dev/null +++ b/.htaccess @@ -0,0 +1,4 @@ +Options +FollowSymLinks + +RewriteEngine on +RewriteRule ^([^/]*)$ policies/$1 [L] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0707f0b --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +.SUFFIXES: +.SUFFIXES: .txt .html + +SRCS = +OBJS = $(SRCS:.txt=.html) + +.PHONY: all +all: $(OBJS) + +$(OBJS): + @printf ' RENDER %s\n' '$@' + @title=$$(sed -n 's/^ Title: \(.*\)$$/\1/p' $*.txt | \ + head -n 1); \ + sed "s#@TITLE@#$$title#" include/header.html > $@ + @markdown $*.txt >> $@ + @cat include/footer.html >> $@ + +.PHONY: clean +clean: + @for obj in $(OBJS); do \ + printf ' RM %s\n' "$${obj}"; \ + rm -f $${obj}; \ + done diff --git a/include/footer.html b/include/footer.html new file mode 100644 index 0000000..7fb2bd6 --- /dev/null +++ b/include/footer.html @@ -0,0 +1,2 @@ + </body> +</html> diff --git a/include/header.html b/include/header.html new file mode 100644 index 0000000..3324427 --- /dev/null +++ b/include/header.html @@ -0,0 +1,10 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>@TITLE@</title> + <link type="text/css" rel="stylesheet" href="main.css" /> + </head> + <body> |