Skip to content

Commit 12ebfa2

Browse files
committed
feat(Makefile): update theme submodules, hugo server render to Memory and read base url from hugo config
1 parent 6ce9705 commit 12ebfa2

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

Makefile

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
serve:
1+
HUGO_DEV_PORT = 1313
2+
HUGO_HOMEPAGE = $(shell hugo config --format json \
3+
| jq --raw-output '.baseurl' \
4+
| sed 's|https://\([^/]\+\)/|http://127.0.0.1/|' \
5+
| sed 's|127.0.0.1|127.0.0.1:$(HUGO_DEV_PORT)|')
6+
HUGO_SERVER_OPTS = --noHTTPCache --buildDrafts --renderToMemory
7+
8+
.PHONY: theme
9+
theme:
10+
git submodule update --init --recursive
11+
12+
serve: theme
213
hugo --quiet version
3-
(sleep 1 ; xdg-open http://localhost:1313/blog) >/dev/null 2>&1 &
4-
hugo server --noHTTPCache --buildDrafts
14+
(sleep 1 ; xdg-open $(HUGO_HOMEPAGE)) >/dev/null 2>&1 &
15+
hugo server $(HUGO_SERVER_OPTS)
16+
17+
.PHONY: PRINT-MACROS
18+
PRINT-MACROS:
19+
@make --print-data-base \
20+
| grep -A1 "^# makefile" \
21+
| grep -v "^#\|^--" \
22+
| sort

0 commit comments

Comments
 (0)