diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..94a2486 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +CONTENT_FILES := $(wildcard content/**/*.md) + +.DEFAULT_GOAL := help + +.PHONY: help +help: + @printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n" + @grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-15s\033[0m %s\n", $$1, $$2}' + +.PHONY: run +run: static/js/lunr/PagesIndex.json ## Start development environment + @docker-compose up -d hugo + +.PHONY: logs +logs: ## Tail development logs + @docker-compose logs -f --since=1m + +.PHONY: update-search-index +update-search-index: static/js/lunr/PagesIndex.json ## Update the search index if needed + +static/js/lunr/PagesIndex.json: $(CONTENT_FILES) + @echo "Rebuilding search index..." + @docker-compose run --rm node docker/prod-host/search-indexer.js