diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..0f7c8a28d69b71780005089433676837bd8374af --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +PUG = $(shell pwd)/node_modules/pug-cli/index.js --basedir . + +all: index.html privacy-policy/index.html releases/index.html + +%.html: %.pug + $(PUG) $< diff --git a/assets/css/Makefile b/assets/css/Makefile index 2c52408c1391e75fbe536fcc4fe75311b917c01e..d943d6bb3839fb7802d2976cfc61c76ab5317682 100644 --- a/assets/css/Makefile +++ b/assets/css/Makefile @@ -1,10 +1,8 @@ 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 . + +%.css: %.sass + $(SASS) $< -o . +%.css: %.scss + $(SASS) $< -o . diff --git a/assets/css/generate_makefile.sh b/assets/css/generate_makefile.sh deleted file mode 100755 index c82f4a35fb90c7ead087f22a529b7e8a8a7e329c..0000000000000000000000000000000000000000 --- a/assets/css/generate_makefile.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -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 68446498890128a78b73710e0e2f5b587bb5afd0..278475ae6a2a06e0f66951787152a73fd38de628 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "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", - "sass": "assets/css/generate_makefile.sh && cd assets/css && make", - "images": "assets/images/generate_makefile.sh && cd assets/images && make", + "pug": "make -j8", + "sass": "cd assets/css && make -j8", + "images": "assets/images/generate_makefile.sh && cd assets/images && make -j8", "build": "npm run images && npm run sass && npm run pug" }, "author": "Janne Koschinski",