From fe48bee6e9d409704bc09b1ae5527e2de1115fc8 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 21 Dec 2020 21:16:43 +0100 Subject: Added makefile --- scripts/build_content.sh | 8 ++++++++ scripts/build_fonts.sh | 13 +++++++++++++ scripts/build_sass.sh | 4 ++++ scripts/serve.sh | 3 +++ scripts/watch_content.sh | 5 +++++ scripts/watch_sass.sh | 5 +++++ 6 files changed, 38 insertions(+) create mode 100755 scripts/build_content.sh create mode 100755 scripts/build_fonts.sh create mode 100755 scripts/build_sass.sh create mode 100755 scripts/serve.sh create mode 100755 scripts/watch_content.sh create mode 100755 scripts/watch_sass.sh (limited to 'scripts') diff --git a/scripts/build_content.sh b/scripts/build_content.sh new file mode 100755 index 0000000..4476d45 --- /dev/null +++ b/scripts/build_content.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +SITE_TITLE="Volpeon's Den" + +find content/ \ + -iname "*.md" \ + -type f \ + -exec sh -c 'TARGET=dist/$(echo ${0%.md}.html | cut -sd / -f 2-); mkdir -p $(dirname $TARGET) && pandoc "${0}" -t html5 --template templates/base.html -o "$TARGET" --metadata sitetitle="$1"' {} "$SITE_TITLE" \; diff --git a/scripts/build_fonts.sh b/scripts/build_fonts.sh new file mode 100755 index 0000000..d7c5e13 --- /dev/null +++ b/scripts/build_fonts.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +pyftsubset assets/iosevka-term-ss09-regular.ttf \ + --text-file='assets/glyphs.txt' \ + --layout-features+=ss09,dlig \ + --flavor='woff2' \ + --output-file='dist/iosevka-term-ss09-regular.woff2' + +pyftsubset assets/iosevka-term-ss09-bold.ttf \ + --text-file='assets/glyphs.txt' \ + --layout-features+=ss09,dlig \ + --flavor='woff2' \ + --output-file='dist/iosevka-term-ss09-bold.woff2' diff --git a/scripts/build_sass.sh b/scripts/build_sass.sh new file mode 100755 index 0000000..6334acc --- /dev/null +++ b/scripts/build_sass.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sassc assets/style.scss dist/style.css +node_modules/.bin/postcss dist/style.css -r diff --git a/scripts/serve.sh b/scripts/serve.sh new file mode 100755 index 0000000..10e45a4 --- /dev/null +++ b/scripts/serve.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +python -m http.server --bind 127.0.0.1 --directory dist diff --git a/scripts/watch_content.sh b/scripts/watch_content.sh new file mode 100755 index 0000000..59d60a4 --- /dev/null +++ b/scripts/watch_content.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +while inotifywait -r -e close_write content; do + scripts/build_content.sh +done diff --git a/scripts/watch_sass.sh b/scripts/watch_sass.sh new file mode 100755 index 0000000..69605dc --- /dev/null +++ b/scripts/watch_sass.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +while inotifywait -r -e close_write assets; do + scripts/build_sass.sh +done -- cgit v1.2.3-54-g00ecf