website created
This commit is contained in:
32
Makefile
Normal file
32
Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
.PHONY: help serve size validate clean
|
||||
|
||||
help: ## Show this help
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
|
||||
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
serve: ## Start a local static server on :8000
|
||||
@command -v python3 >/dev/null 2>&1 && \
|
||||
python3 -m http.server 8000 || \
|
||||
(command -v npx >/dev/null 2>&1 && npx --yes http-server -p 8000) || \
|
||||
echo "Install python3 or node to serve locally."
|
||||
|
||||
size: ## Report file sizes
|
||||
@echo "HTML:"
|
||||
@find . -maxdepth 2 -name "*.html" -printf " %-30p %s bytes\n"
|
||||
@echo
|
||||
@echo "CSS:"
|
||||
@find static/css -name "*.css" -printf " %-30p %s bytes\n"
|
||||
@echo
|
||||
@echo "Images (svg):"
|
||||
@find static/img -name "*.svg" -printf " %-30p %s bytes\n"
|
||||
|
||||
validate: ## Quick HTML sanity check (counts opening vs closing tags)
|
||||
@for f in *.html; do \
|
||||
open=$(grep -oE '<[a-zA-Z][a-zA-Z0-9-]*' "$$f" | grep -vE '^<(br|hr|img|input|meta|link|source|area|base|col|embed|param|track|wbr|!--)' | sed 's/^<//' | sort -u); \
|
||||
close=$$(grep -oE '</[a-zA-Z][a-zA-Z0-9-]*' "$$f" | sed 's/^<\///' | sort -u); \
|
||||
echo "$$f"; \
|
||||
diff <(echo "$$open") <(echo "$$close") || true; \
|
||||
done
|
||||
|
||||
clean: ## Remove generated artifacts
|
||||
@rm -rf bin/ node_modules/ dist/
|
||||
Reference in New Issue
Block a user