Skip to content

Commit 0c793c2

Browse files
committed
Add Makefile that downloads and runs Hugo
1 parent ca53c58 commit 0c793c2

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.hugo_build.lock
22
public
3+
bin

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
PORT=1313
2+
HUGO_VERSION=0.134.0
3+
HUGO_PLATFORM_ARCH=linux-amd64
4+
HUGO_URL=https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_$(HUGO_VERSION)_$(HUGO_PLATFORM_ARCH).tar.gz
5+
6+
.PHONY: serve
7+
serve: bin/hugo
8+
bin/hugo server -b localhost:$(PORT)
9+
10+
.PHONY: build
11+
hugo: bin/hugo
12+
bin/hugo --minify
13+
14+
setup: bin/hugo
15+
16+
bin/hugo: bin/hugo.tar.gz
17+
tar -xvf bin/hugo.tar.gz -C bin
18+
touch bin/hugo
19+
20+
bin/hugo.tar.gz:
21+
mkdir -p bin
22+
wget $(HUGO_URL) -O bin/hugo.tar.gz
23+
24+
.PHONY: clean
25+
clean:
26+
rm -rf bin public

0 commit comments

Comments
 (0)