diff --git a/assets/css/Makefile b/assets/css/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..2c52408c1391e75fbe536fcc4fe75311b917c01e --- /dev/null +++ b/assets/css/Makefile @@ -0,0 +1,10 @@ +SASS = $(shell pwd)/../../node_modules/node-sass/bin/node-sass --output-style compressed +all: fonts.css style.css important.css semantic.css +fonts.css: fonts.sass + $(SASS) fonts.sass -o . +style.css: style.sass + $(SASS) style.sass -o . +important.css: important.scss + $(SASS) important.scss -o . +semantic.css: semantic.scss + $(SASS) semantic.scss -o . diff --git a/assets/css/generate_makefile.sh b/assets/css/generate_makefile.sh new file mode 100755 index 0000000000000000000000000000000000000000..6755fe4007e5ab3ebb4988ba1dad15ca1bf2266f --- /dev/null +++ b/assets/css/generate_makefile.sh @@ -0,0 +1,39 @@ +#!/bin/bash +QUALITY=85 +THUMB_QUALITY_PNG=70 +THUMB_QUALITY_JPG=50 + +cd $(dirname $(realpath -s ${0})) + +RULES=() + +function generate_rule() { + file=${1} + filename=${2} + + RULES+=("${filename}.css") + echo "${filename}.css: ${file}" >> Makefile.wip + echo " \$(SASS) ${file} -o ." >> 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 +SASS = \$(shell pwd)/../../node_modules/node-sass/bin/node-sass --output-style compressed +EOF +for file in *.sass; do + generate_rule ${file} ${file%.*} +done +for file in *.scss; do + generate_rule ${file} ${file%.*} +done + +finalize \ No newline at end of file diff --git a/package.json b/package.json index 6121aae6bb8cb61624251a14ad9bd06d23d1497a..68446498890128a78b73710e0e2f5b587bb5afd0 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "This is a websearch frontend for a quassel database.", "scripts": { "pug": "node_modules/pug-cli/index.js --basedir . **/index.pug index.pug", - "sass": "node_modules/node-sass/bin/node-sass assets/css/ -o assets/css/ --output-style compressed", - "assets": "assets/images/generate_makefile.sh && cd assets/images && make", - "build": "npm run assets && npm run sass && npm run pug" + "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" }, "author": "Janne Koschinski", "license": "GPL",