Skip to content

Commit 60c9945

Browse files
committed
Experiment with Hugo-plate
1 parent 763353c commit 60c9945

4 files changed

Lines changed: 84 additions & 0 deletions

File tree

hugo_test/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.git/
2+
public/
3+
resources/

hugo_test/.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
node_modules/
2+
package.json
3+
4+
# Hugo generated files
5+
public/
6+
resources/
7+
themes/
8+
hugo_stats.json
9+
.hugo_build.lock
10+
go.sum
11+
12+
# HugoPlat exampleSite
13+
assets/
14+
config/
15+
content/
16+
data/
17+
i18n/
18+
go.mod
19+
hugo.toml

hugo_test/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM hugomods/hugo:latest AS site
2+
WORKDIR /site/
3+
RUN git clone https://github.com/zeon-studio/hugoplate.git themes/hugoplate
4+
RUN cp themes/hugoplate/package.json . && npm install
5+
RUN cp -R themes/hugoplate/exampleSite/* .
6+
RUN sed -i 's/https:\/\/example.org/http:\/\/localhost/g' hugo.toml
7+
#COPY . .
8+
RUN hugo
9+
10+
FROM nginx:alpine AS nginx
11+
WORKDIR /usr/share/nginx/html
12+
COPY --from=site /site/public/ .
13+
COPY --from=site /site/resources/_gen/ .
14+
EXPOSE 80

hugo_test/Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
DOCKER_IMAGE='computingteachers'
2+
3+
.PHONEY: hugo
4+
hugo: hugo.toml node_modules
5+
hugo
6+
hugo.toml: themes/hugoplate
7+
cp -R themes/hugoplate/exampleSite/* .
8+
node_modules: package.json
9+
npm install
10+
package.json: themes/hugoplate
11+
cp themes/hugoplate/package.json .
12+
themes/hugoplate:
13+
git clone --recurse-submodules https://github.com/zeon-studio/hugoplate.git themes/hugoplate
14+
15+
16+
public: clean
17+
docker build --tag ${DOCKER_IMAGE} --target site .
18+
19+
docker create --name=${DOCKER_IMAGE} ${DOCKER_IMAGE}
20+
docker cp ${DOCKER_IMAGE}:/site/public/ public/
21+
docker rm ${DOCKER_IMAGE}
22+
23+
.PHONEY: serve_nginx
24+
serve_nginx:
25+
docker build --tag ${DOCKER_IMAGE}nginx .
26+
docker run --rm --publish 80:80 ${DOCKER_IMAGE}nginx
27+
28+
clean:
29+
docker image rm --force ${DOCKER_IMAGE} ${DOCKER_IMAGE}nginx
30+
rm -rf \
31+
public \
32+
resources \
33+
go.* \
34+
hugo_stats.json \
35+
assets \
36+
.hugo_* \
37+
hugo.toml \
38+
config \
39+
content \
40+
data \
41+
i18n \
42+
package.json \
43+
package-lock.json \
44+
45+
clean_all: clean
46+
rm -rf \
47+
themes \
48+
node_modules \

0 commit comments

Comments
 (0)