lucidiot
/
breadsite
Archived
1
0
Fork 0
This repository has been archived on 2023-02-23. You can view files and clone it, but cannot push or open issues or pull requests.
breadsite/build.sh

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