Skip to content
Snippets Groups Projects
Commit 51df7459 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Updated pug to also use make

parent 3365fc66
Branches
No related tags found
No related merge requests found
PUG = $(shell pwd)/node_modules/pug-cli/index.js --basedir .
all: index.html privacy-policy/index.html releases/index.html
index.html: index.pug
$(PUG) index.pug
privacy-policy/index.html: privacy-policy/index.pug
$(PUG) privacy-policy/index.pug
releases/index.html: releases/index.pug
$(PUG) releases/index.pug
#!/bin/bash
QUALITY=85
THUMB_QUALITY_PNG=70
THUMB_QUALITY_JPG=50
cd $(dirname $(realpath -s ${0}))
......
#!/bin/bash
cd $(dirname $(realpath -s ${0}))
RULES=()
function generate_rule() {
file=${1}
filename=${2}
RULES+=("${filename}.html")
echo "${filename}.html: ${file}" >> Makefile.wip
echo " \$(PUG) ${file}" >> Makefile.wip
}
function finalize() {
echo -n "all:" >> Makefile
for rule in "${RULES[@]}"; do
echo -n " $rule" >> Makefile
done
echo >> Makefile
cat Makefile.wip >> Makefile
rm Makefile.wip
}
cat <<EOF > Makefile
PUG = \$(shell pwd)/node_modules/pug-cli/index.js --basedir .
EOF
for file in *.pug **/*.pug; do
filename=${file##*/}
if [[ ${filename} != _* ]]; then
generate_rule ${file} ${file%.*}
fi
done
finalize
\ No newline at end of file
......@@ -3,7 +3,7 @@
"version": "3.0.0",
"description": "This is a websearch frontend for a quassel database.",
"scripts": {
"pug": "node_modules/pug-cli/index.js --basedir . **/index.pug index.pug",
"pug": "./generate_makefile.sh && make",
"sass": "assets/css/generate_makefile.sh && cd assets/css && make",
"images": "assets/images/generate_makefile.sh && cd assets/images && make",
"build": "npm run images && npm run sass && npm run pug"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment