Add basic Makefile
This commit is contained in:
parent
54fc47e601
commit
9489390299
23
Makefile
Normal file
23
Makefile
Normal file
@ -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
|
||||||
Loading…
Reference in New Issue
Block a user