-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (29 loc) · 980 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
SHELL := /bin/bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
SITE_PATH := mysite
help:
@printf "Usage: make [target] [VARIABLE=value]\nTargets:\n"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
hooks: ## Setup pre commit.
@pre-commit install
@pre-commit gc
validate: ## Validate files with pre-commit hooks
@pre-commit run --all-files
deploy: ## Deploy github pages
@npm run deploy
open: ## Open in browser
@open "https://ivankatliarchuk.github.io/"
start: ## Start Server
@hugo server -D -s $(SITE_PATH)
generate: ## Generate site
@hugo -D -d ../docs -s $(SITE_PATH)
submodules: ## Update submodules
@git submodule update --remote --recursive
update: ## Update Hugo modules
@cd mysite; hugo mod tidy
@cd mysite; hugo mod npm pack
@cd mysite; npm install
.PHONY: help validate hooks deploy open