Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
122 lines (104 loc) Β· 3.14 KB
/
Copy pathMakefile
File metadata and controls
122 lines (104 loc) Β· 3.14 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
HUGO_VERSION := 0.136.5
# HUGO_CMD := container run --rm -v $(PWD):/project -v $(HOME)/Library/Caches/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:v$(HUGO_VERSION)
HUGO_CMD := hugo
PRUNE_DRY_RUN ?= 1
ifeq ($(PRUNE_DRY_RUN),1)
PRUNE_DRY_RUN_FLAG := --dry-run
else
PRUNE_DRY_RUN_FLAG :=
endif
.PHONY : help
help :
$(HUGO_CMD) help
.PHONY: setup
setup:
mise install
.PHONY : update
update :
$(HUGO_CMD) mod get -u
.PHONY : build
build :
$(HUGO_CMD) build
.PHONY : server
server :
$(HUGO_CMD) --logLevel info server --bind=0.0.0.0
.PHONY : run
run : update server
.PHONY: check-broken-links
check-broken-links: build
lychee public --mode emoji \
--root-dir $(CURDIR)/public \
--config .lychee/config.toml \
--exclude-file .lychee/exclude-temporary.txt \
--exclude-file .lychee/exclude-permanent.txt
.PHONY: prune-lychee-excludes
prune-lychee-excludes: build
@if grep -qE '^[^#[:space:]]' .lychee/exclude-temporary.txt; then \
uv run scripts/prune_lychee_excludes.py \
--prepare \
--public-dir public \
--exclude-file .lychee/exclude-temporary.txt \
--links-output lychee-input.txt; \
if [ ! -s lychee-input.txt ]; then \
echo "no matching links"; \
exit 0; \
fi; \
lychee --mode emoji \
--config .lychee/config.toml \
lychee-input.txt \
--format json \
--output lychee-excludes.json; \
uv run scripts/prune_lychee_excludes.py \
--public-dir public \
$(PRUNE_DRY_RUN_FLAG) \
--json lychee-excludes.json \
--exclude-file .lychee/exclude-temporary.txt; \
else \
echo "no temporary excludes"; \
fi
.PHONY : post
post:
ifeq ($(name),)
$(error name for the post is not set: make post name=YOUR-POST-NAME)
endif
$(HUGO_CMD) new --kind post post/$(name)
.PHONY : news
news:
ifeq ($(name),)
$(error name for the news is not set: make news name=YOUR-NEWS-NAME)
endif
$(HUGO_CMD) new --kind post news/$(name)
.PHONY : publication
publication:
ifeq ($(name),)
$(error name for the publication is not set: make publication name=AUTHOR-YEAR-TITLE)
endif
$(HUGO_CMD) new --kind publication publication/$(name)
.PHONY : event
event:
ifeq ($(name),)
$(error name for the event is not set: make event name=EVENT-TALK-NAME)
endif
$(HUGO_CMD) new --kind event event/$(name)
.PHONY : ogp-image
ogp-image: setup
ifeq ($(name),)
$(error name for the OGP image is not set: make ogp-image name=PUBLICATION-NAME)
endif
./scripts/generate_ogp_image_for_publication.sh $(name)
.PHONY : publication-thumbnail
publication-thumbnail:
$(eval EXPANDED_PDF := $(shell echo $(pdf)))
magick "$(EXPANDED_PDF)[0]" -resize '640x640^' -crop '640x480+0+0' -alpha remove $(PWD)/content/publication/$(name)/featured.png
.PHONY : poster-thumbnail
poster-thumbnail:
ifeq ($(name),)
$(error name for the poster thumbnail is not set: make poster-thumbnail name=PUBLICATION-NAME)
endif
uv run python .agents/skills/hugo-poster-project-sync/scripts/create_poster_thumbnail.py --repo-root . --name $(name)
.PHONY : add-conference-tags-dry-run
add-conference-tags-dry-run:
uv run --with ruamel.yaml python scripts/add_conference_tags.py --dry-run
.PHONY : add-conference-tags
add-conference-tags:
uv run --with ruamel.yaml python scripts/add_conference_tags.py