From fa37ff161d4292650d9c2d21e1a780ff81879e01 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 28 Feb 2020 01:00:33 +0100 Subject: set page title from initial header line --- Makefile | 5 ++++- index.mdwn | 2 +- style.scss | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 63ceea8..cf14472 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ hypertext = $(subst index/index,index,$(markdown:%.mdwn=%/index.html)) graph := $(wildcard *.dot */*.dot */*/*.dot) vectorimage-graph := $(graph:%.dot=%.svg) +sitetitle := $(shell head --lines=1 index.mdwn | grep --perl-regexp --only-matching '^\#\s*\K(\S+(\s\S+)*)+') + compass_plugins = h5bp all: $(hypertext) $(vectorimage-graph) style.css @@ -21,8 +23,9 @@ $(vectorimage-graph): %.svg: %.dot Makefile dot -Tsvg -o$@ $< %.html %/index.html: %.mdwn $(hypertext-snippets) Makefile + $(eval title = $(shell head --lines=1 $< | grep --perl-regexp --only-matching '^\#\s*\K(\S+(\s\S+)*)+')) $(if $(filter-out ./,$(dir $@)),mkdir -p $(dir $@)) - pandoc -s -c $(shell realpath --relative-to=$(dir $@) style.css) -B topbar.html -A footer.html -f commonmark -t html -o $@ $< + pandoc -s $(if $(title),--metadata pagetitle='$(if $(filter-out $(sitetitle),$(title)),$(sitetitle) -- )$(title)') -c $(shell realpath --relative-to=$(dir $@) style.css) -B topbar.html -A footer.html -f commonmark -t html -o $@ $< %.css : %.scss Makefile # scss --compass --style compressed $< $@ diff --git a/index.mdwn b/index.mdwn index 3b90eec..78b4fae 100644 --- a/index.mdwn +++ b/index.mdwn @@ -1,4 +1,4 @@ -# KASSANDRA PRODUCTION +# Kassandra Production Valdemarsgade 1 DK-8000 Aarhus C, Denmark diff --git a/style.scss b/style.scss index 3a4a6b4..31ee60e 100644 --- a/style.scss +++ b/style.scss @@ -10,6 +10,7 @@ h1 { font-weight: normal; + text-transform: uppercase; } body { -- cgit v1.2.3