<commit_before>HUGO = hugo
SASS = node_modules/sass/sass.js
POSTCSS = node_modules/postcss-cli/bin/postcss
HTMLMIN = node_modules/html-minifier/cli.js

SASS_FLAGS = --style=compressed
POSTCSS_FLAGS = --no-map -u autoprefixer
HTMLMIN_FLAGS = --collapse-whitespace --collapse-boolean-attributes --remove-comments --remove-empty-attributes --remove-redundant-attributes

HUGO_FILES = $(shell find archetypes content layouts static -type f)
SASS_FILES = $(shell find "assets/css" -type f -name '*.scss')

.PHONY: all
all: post

.PHONY: clean
clean:
	rm -rf public
	rm -f static/main.css{,.map}

static/main.css: assets/css/main.scss $(SASS_FILES)
	$(SASS) $(SASS_FLAGS) $< | $(POSTCSS) $(POSTCSS_FLAGS) -o $@

public: $(HUGO_FILES) static/main.css
	$(HUGO)

.PHONY: post
post: public
	$(HTMLMIN) $(HTMLMIN_FLAGS) --file-ext html --input-dir public --output-dir public
	find 'public' -type f \( -name '*html' -or -name '*.xml' -or -name '*.svg' -or -name '*.css' -or -name '*.js' \) -exec gzip -9kf {} +

.PHONY: deploy
deploy: post
	rsync -rz --delete 'public/' 'alex@archer:/usr/local/www/alexj.org/'

.PHONY: serve
serve: static/main.css
	$(HUGO) server<commit_msg>Show drafts when serving local copy of page<commit_after>HUGO = hugo
SASS = node_modules/sass/sass.js
POSTCSS = node_modules/postcss-cli/bin/postcss
HTMLMIN = node_modules/html-minifier/cli.js

SASS_FLAGS = --style=compressed
POSTCSS_FLAGS = --no-map -u autoprefixer
HTMLMIN_FLAGS = --collapse-whitespace --collapse-boolean-attributes --remove-comments --remove-empty-attributes --remove-redundant-attributes

HUGO_FILES = $(shell find archetypes content layouts static -type f)
SASS_FILES = $(shell find "assets/css" -type f -name '*.scss')

.PHONY: all
all: post

.PHONY: clean
clean:
	rm -rf public
	rm -f static/main.css{,.map}

static/main.css: assets/css/main.scss $(SASS_FILES)
	$(SASS) $(SASS_FLAGS) $< | $(POSTCSS) $(POSTCSS_FLAGS) -o $@

public: $(HUGO_FILES) static/main.css
	$(HUGO)

.PHONY: post
post: public
	$(HTMLMIN) $(HTMLMIN_FLAGS) --file-ext html --input-dir public --output-dir public
	find 'public' -type f \( -name '*html' -or -name '*.xml' -or -name '*.svg' -or -name '*.css' -or -name '*.js' \) -exec gzip -9kf {} +

.PHONY: deploy
deploy: post
	rsync -rz --delete 'public/' 'alex@archer:/usr/local/www/alexj.org/'

.PHONY: serve
serve: static/main.css
	$(HUGO) server --buildDrafts
{'fraction_non_alphanumeric': 0.16877637130801687, 'fraction_numerical': 0.0008438818565400844, 'mean_word_length': 3.8486707566462166, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5570523', 'n_tokens_mistral': 934, 'n_tokens_neox': 898, 'n_words': 227}