We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ce9705 commit 12ebfa2Copy full SHA for 12ebfa2
Makefile
@@ -1,4 +1,22 @@
1
-serve:
+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
13
hugo --quiet version
- (sleep 1 ; xdg-open http://localhost:1313/blog) >/dev/null 2>&1 &
- 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