26 lines
633 B
Bash
Executable File
26 lines
633 B
Bash
Executable File
#!/bin/bash
|
|
shopt -s globstar
|
|
|
|
for file in content/**/*.md; do
|
|
output="${file/#content/html}"
|
|
output="${output/%.md/.html}"
|
|
mkdir -p "$(dirname "$output")"
|
|
echo "Building $file to $output"
|
|
pandoc \
|
|
--read markdown \
|
|
--write html \
|
|
--standalone \
|
|
--include-in-header include-header.html \
|
|
--include-before-body include-before.html \
|
|
--include-after-body include-after.html \
|
|
--css $(echo "$(dirname $(dirname "$file"))/theme.css" | sed 's|^\./||;s|[^/]*/|../|g') \
|
|
-o "$output" \
|
|
"$file"
|
|
done
|
|
|
|
for src in assets/*; do
|
|
dest="${src/#assets/html}"
|
|
echo "Symlinking $src to $dest"
|
|
ln -fTs "../$src" "$dest"
|
|
done
|