2017-04-30 12:02:21 +01:00
|
|
|
BASEDIR=$(PWD)
|
2018-01-04 13:05:57 +00:00
|
|
|
NODE_BIN=$(BASEDIR)/node_modules/.bin
|
2017-04-30 12:02:21 +01:00
|
|
|
|
|
|
|
STATIC_SRC=$(BASEDIR)/static/src
|
|
|
|
STATIC_BUILD=$(BASEDIR)/static/build
|
|
|
|
OUTPUT_DIR=$(BASEDIR)/public
|
|
|
|
|
|
|
|
|
2017-11-11 16:34:29 +00:00
|
|
|
release: build
|
|
|
|
$(NODE_BIN)/speedpack $(OUTPUT_DIR) -o $(OUTPUT_DIR)
|
|
|
|
|
|
|
|
|
2017-04-30 12:02:21 +01:00
|
|
|
build: install
|
|
|
|
rm -rf $(OUTPUT_DIR)
|
2017-05-07 16:33:20 +01:00
|
|
|
rm -rf $(STATIC_BUILD)
|
2018-01-04 13:08:00 +00:00
|
|
|
rm -rf $(BASEDIR)/resources
|
2017-04-30 12:05:44 +01:00
|
|
|
mkdir -p $(STATIC_BUILD)/js $(STATIC_BUILD)/css
|
2017-10-27 13:36:18 +01:00
|
|
|
hugo gen chromastyles --style=monokai > $(STATIC_SRC)/scss/highlight.css
|
2017-04-30 12:02:21 +01:00
|
|
|
$(NODE_BIN)/browserify $(STATIC_SRC)/js/index.js -o $(STATIC_BUILD)/js/app.js
|
|
|
|
$(NODE_BIN)/node-sass $(STATIC_SRC)/scss/style.scss $(STATIC_BUILD)/css/style.css --source-map-embed
|
2017-07-09 17:49:45 +01:00
|
|
|
cp -r $(BASEDIR)/node_modules/lightgallery/dist/fonts $(STATIC_BUILD)
|
2017-05-07 16:33:20 +01:00
|
|
|
cp -r $(STATIC_SRC)/img $(STATIC_BUILD)/img
|
2018-01-04 10:54:24 +00:00
|
|
|
@hugo -vDEF --stepAnalysis --gc
|
2018-01-01 17:54:27 +00:00
|
|
|
mkdir -p $(OUTPUT_DIR)/.well-known/
|
2018-01-04 13:05:57 +00:00
|
|
|
cp $(BASEDIR)/static/keybase.txt $(OUTPUT_DIR)/keybase.txt
|
|
|
|
cp $(BASEDIR)/static/security.txt $(OUTPUT_DIR)/.well-known/security.txt
|
2017-04-30 12:02:21 +01:00
|
|
|
|
2017-05-08 09:18:45 +01:00
|
|
|
server: build
|
2018-01-04 10:54:24 +00:00
|
|
|
hugo server --noHTTPCache --disableFastRender --gc
|
2017-05-08 09:18:45 +01:00
|
|
|
|
2017-04-30 12:02:21 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(STATIC_BUILD)
|
|
|
|
rm -rf $(OUTPUT_DIR)
|
|
|
|
rm -rf $(BASEDIR)/node_modules
|
|
|
|
|
|
|
|
|
|
|
|
install: node_modules
|
|
|
|
@hugo version
|
|
|
|
|
|
|
|
node_modules:
|
|
|
|
npm install
|
|
|
|
|
|
|
|
|
2017-04-30 22:46:42 +01:00
|
|
|
test:
|
2017-04-30 22:52:59 +01:00
|
|
|
$(NODE_BIN)/sass-lint -vqc .sass-lint.yml
|
2017-12-31 21:49:33 +00:00
|
|
|
$(NODE_BIN)/eslint $(STATIC_SRC)/js
|
2017-05-06 15:41:03 +01:00
|
|
|
$(NODE_BIN)/yamllint data/*.yml
|
|
|
|
$(NODE_BIN)/yamllint config.yml
|
2018-01-04 10:58:48 +00:00
|
|
|
$(NODE_BIN)/mdspell --en-gb -ranx 'content/**/*.md'
|
2018-02-13 21:43:09 +00:00
|
|
|
$(NODE_BIN)/blcl -ero ./public/
|
|
|
|
|
|
|
|
deadlink:
|
2018-02-04 13:04:38 +00:00
|
|
|
$(NODE_BIN)/blcl -ro ./public/ \
|
|
|
|
--exclude "open.spotify.com"\
|
|
|
|
--exclude "p.scdn.co"\
|
|
|
|
--exclude "staticflickr.com"\
|
|
|
|
--exclude "twitter.com/intent"\
|
|
|
|
--exclude "facebook.com/sharer"\
|
2018-02-13 21:43:09 +00:00
|
|
|
--exclude "reddit.com/submit"
|
2017-04-30 22:46:42 +01:00
|
|
|
|
|
|
|
.PHONY: build clean install test
|