This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
105 lines (84 loc) · 2.25 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Default Goal
.DEFAULT_GOAL := all
# Variables
HUGO_FLAGS := --gc --minify
BASE_URL := http://localhost:1313
LANDING_PAGES := $(patsubst content/landing/%.md,%,$(wildcard content/landing/*.md))
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# General Targets
# Run everything in sequence: clean, update, normalize, and build
.PHONY: all
all: debug clean update-wowchemy normalize-yaml build format lint
# Clean the environment
.PHONY: clean
clean:
rm -rf public
hugo mod clean
hugo mod tidy
# Update wowchemy modules
.PHONY: update-wowchemy
update-wowchemy:
hugo mod get -u ./...
hugo mod tidy
# Normalize YAML
.PHONY: normalize-yaml
normalize-yaml:
hugo convert toYAML --unsafe
# Build the Hugo site
.PHONY: build
build:
hugo $(HUGO_FLAGS)
# Start the Hugo server
.PHONY: serve
serve:
hugo serve $(HUGO_FLAGS) --buildFuture
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Specialized Targets for creating content
.PHONY: post
post:
poetry run python scripts/hugo_new.py post
.PHONY: event
event:
poetry run python scripts/hugo_new.py event
.PHONY: project
project:
poetry run python scripts/hugo_new.py project
.PHONY: press-release
press-release:
poetry run python scripts/hugo_new.py press-release --is_post_archetype
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Debug and Info
# Display Hugo environment details
.PHONY: debug
debug:
hugo env
go version
.PHONY: clipboard-content-primary
clipboard-content-primary:
cat \
content/_index.md \
content/about.md \
content/services.md \
| xclip -selection clipboard
.PHONY: clipboard-content-landing
clipboard-content-landing:
cat \
content/landing/*.md \
| xclip -selection clipboard
.PHONY: open-landing-pages
open-landing-pages:
@for page in $(LANDING_PAGES); do \
open "$(BASE_URL)/landing/$$page/"; \
done
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Python Targets
.PHONY: format
format:
poetry run black .
poetry run isort .
poetry run ruff --fix .
.PHONY: lint
lint:
poetry run black --check .
poetry run isort -c .
poetry run ruff check .