Skip to content

Commit efe1410

Browse files
authored
Merge pull request #454 from puzzle/update-from-template
Update from template
2 parents e013d03 + 829faa4 commit efe1410

File tree

8 files changed

+2567
-292
lines changed

8 files changed

+2567
-292
lines changed

Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM docker.io/klakegg/hugo:0.111.3-ext-ubuntu AS builder
1+
FROM docker.io/floryn90/hugo:0.138.0-ext-ubuntu AS builder
22

33
ARG TRAINING_HUGO_ENV=default
44

55
COPY . /src
66

77
RUN hugo --environment ${TRAINING_HUGO_ENV} --minify
88

9-
FROM docker.io/ubuntu:jammy AS wkhtmltopdf
9+
FROM docker.io/ubuntu:noble AS wkhtmltopdf
1010
RUN apt-get update \
1111
&& apt-get install -y curl \
1212
&& curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb --output wkhtmltox_0.12.6.1-2.jammy_amd64.deb \
@@ -17,16 +17,19 @@ RUN apt-get update \
1717

1818
COPY --from=builder /src/public /
1919

20-
RUN wkhtmltopdf --outline-depth 4 --enable-internal-links --enable-local-file-access ./pdf/index.html /pdf.pdf
20+
RUN wkhtmltopdf --outline-depth 4 \
21+
--margin-top 35mm --margin-bottom 22mm --margin-left 15mm --margin-right 10mm \
22+
--enable-internal-links --enable-local-file-access \
23+
/pdf/index.html /pdf.pdf
2124

22-
FROM docker.io/nginxinc/nginx-unprivileged:1.26-alpine
25+
FROM docker.io/nginxinc/nginx-unprivileged:1.27-alpine
2326

24-
LABEL maintainer puzzle.ch
25-
LABEL org.opencontainers.image.title "puzzle.ch's Application Migration and Modernization Techlab"
26-
LABEL org.opencontainers.image.description "Container with puzzle.ch's Application Migration and Modernization Techlab content"
27-
LABEL org.opencontainers.image.authors puzzle.ch
28-
LABEL org.opencontainers.image.source https://github.com/puzzle/amm-techlab/
29-
LABEL org.opencontainers.image.licenses CC-BY-SA-4.0
27+
LABEL maintainer=puzzle.ch
28+
LABEL org.opencontainers.image.title="puzzle.ch's Application Migration and Modernization Techlab"
29+
LABEL org.opencontainers.image.description="Container with puzzle.ch's Application Migration and Modernization Techlab content"
30+
LABEL org.opencontainers.image.authors="puzzle.ch"
31+
LABEL org.opencontainers.image.source="https://github.com/puzzle/amm-techlab/"
32+
LABEL org.opencontainers.image.licenses="CC-BY-SA-4.0"
3033

3134
EXPOSE 8080
3235

README.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ The main part are the labs, which can be found at [content/en/docs](content/en/d
1414

1515
This site is built using the static page generator [Hugo](https://gohugo.io/).
1616

17-
The page uses the [docsy theme](https://github.com/google/docsy) which is included as a Git Submodule.
17+
The page uses the [docsy theme](https://github.com/google/docsy) which is included as a Hugo Module.
1818
Docsy is being enhanced using [docsy-plus](https://github.com/acend/docsy-plus/) as well as
1919
[docsy-acend](https://github.com/acend/docsy-acend/) and [docsy-puzzle](https://github.com/puzzle/docsy-puzzle/)
2020
for brand specific settings.
2121

22-
After cloning the main repo, you need to initialize the submodule like this:
22+
After cloning the main repo, you need to initialize the Hugo Module like this:
2323

2424
```bash
25-
git submodule update --init --recursive
25+
hugo mod get
2626
```
2727

2828
The default configuration uses the puzzle setup from [config/_default](config/_default/config.toml).
@@ -40,12 +40,14 @@ Further, specialized environments can be added in the `config` directory.
4040
Run the following command to update all submodules with their newest upstream version:
4141

4242
```bash
43-
git submodule update --remote
44-
git pull --recurse-submodules
43+
hugo mod get -u
4544
```
4645

4746

48-
## Build using Docker
47+
## Build production image locally
48+
49+
50+
### Docker
4951

5052
Build the image:
5153

@@ -56,40 +58,42 @@ docker build -t puzzle/amm-techlab:latest .
5658
Run it locally:
5759

5860
```bash
59-
docker run -i -p 8080:8080 puzzle/amm-techlab
61+
docker run --rm -p 8080:8080 puzzle/amm-techlab
6062
```
6163

6264

63-
### Using Buildah and Podman
65+
### Buildah and Podman
6466

6567
Build the image:
6668

6769
```bash
6870
buildah build-using-dockerfile -t puzzle/amm-techlab:latest .
6971
```
7072

71-
Run it locally with the following command. Beware that `--rmi` automatically removes the built image when the container stops, so you either have to rebuild it or remove the parameter from the command.
73+
Run it locally:
7274

7375
```bash
74-
podman run --rm --rmi --interactive --publish 8080:8080 localhost/puzzle/amm-techlab
76+
podman run --rm --rmi --publish 8080:8080 localhost/puzzle/amm-techlab
7577
```
7678

79+
**Note:** Beware that `--rmi` automatically removes the built image when the container stops, so you either have to rebuild it or remove the parameter from the command.
80+
7781

7882
## How to develop locally
7983

8084
To develop locally we don't want to rebuild the entire container image every time something changed, and it is also important to use the same hugo versions like in production.
8185
We simply mount the working directory into a running container, where hugo is started in the server mode.
8286

8387
```bash
84-
export HUGO_VERSION=$(grep "FROM docker.io/klakegg/hugo" Dockerfile | sed 's/FROM docker.io\/klakegg\/hugo://g' | sed 's/ AS builder//g')
85-
docker run --rm --interactive --publish 8080:8080 -v $(pwd):/src docker.io/klakegg/hugo:${HUGO_VERSION} server -p 8080 --bind 0.0.0.0
88+
export HUGO_VERSION=$(grep "FROM docker.io/floryn90/hugo" Dockerfile | sed 's/FROM docker.io\/floryn90\/hugo://g' | sed 's/ AS builder//g')
89+
docker run --rm --publish 8080:8080 -v $(pwd):/src docker.io/floryn90/hugo:${HUGO_VERSION} server -p 8080
8690
```
8791

88-
use the following command to set the hugo environment
92+
Use the following command to set the hugo environment
8993

9094
```bash
91-
export HUGO_VERSION=$(grep "FROM docker.io/klakegg/hugo" Dockerfile | sed 's/FROM docker.io\/klakegg\/hugo://g' | sed 's/ AS builder//g')
92-
docker run --rm --interactive --publish 8080:8080 -v $(pwd):/src docker.io/klakegg/hugo:${HUGO_VERSION} server --environment=<environment> -p 8080 --bind 0.0.0.0
95+
export HUGO_VERSION=$(grep "FROM docker.io/floryn90/hugo" Dockerfile | sed 's/FROM docker.io\/floryn90\/hugo://g' | sed 's/ AS builder//g')
96+
docker run --rm --publish 8080:8080 -v $(pwd):/src docker.io/floryn90/hugo:${HUGO_VERSION} server --environment=<environment> -p 8080
9397
```
9498

9599

@@ -108,8 +112,14 @@ npm run mdlint
108112
Npm not installed? no problem
109113

110114
```bash
111-
export HUGO_VERSION=$(grep "FROM docker.io/klakegg/hugo" Dockerfile | sed 's/FROM docker.io\/klakegg\/hugo://g' | sed 's/ AS builder//g')
112-
docker run --rm --interactive -v $(pwd):/src docker.io/klakegg/hugo:${HUGO_VERSION}-ci /bin/bash -c "set -euo pipefail;npm install; npm run mdlint;"
115+
export HUGO_VERSION=$(grep "FROM docker.io/floryn90/hugo" Dockerfile | sed 's/FROM docker.io\/floryn90\/hugo://g' | sed 's/ AS builder//g')
116+
docker run --rm -v $(pwd):/src docker.io/floryn90/hugo:${HUGO_VERSION}-ci /bin/bash -c "npm install && npm run mdlint"
117+
```
118+
119+
Automatically fix errors if possible:
120+
121+
```bash
122+
npm run mdlint-fix
113123
```
114124

115125

config/_default/config.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ breadcrumb_disable = false
9292
sidebar_search_disable = false
9393
# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top nav bar
9494
navbar_logo = true
95-
# Set to true to disable the About link in the site footer
96-
footer_about_disable = true
95+
# Set to false to disable the About link in the site footer
96+
footer_about_enable = false
9797

9898
############################## social links ##############################
9999
[params.links]
@@ -114,6 +114,9 @@ url = "https://linkedin.com/company/puzzle-itc"
114114

115115
# puzzle design
116116
[module]
117+
# uncomment line below for temporary local development of module
118+
# replacements = "github.com/google/docsy -> ../../docsy"
119+
# replacements = "github.com/acend/docsy-plus -> ../../docsy-plus"
117120
[module.hugoVersion]
118121
extended = true
119122
min = "0.100.0"

go.mod

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ module github.com/puzzle/amm-techlab
33
go 1.19
44

55
require (
6+
github.com/FortAwesome/Font-Awesome v0.0.0-20240716171331-37eff7fa00de // indirect
67
github.com/acend/docsy-acend v1.0.0 // indirect
7-
github.com/acend/docsy-plus v0.0.0-20220428195954-da462686a1f4 // indirect
8-
github.com/google/docsy v0.4.0 // indirect
9-
github.com/google/docsy/dependencies v0.4.0 // indirect
8+
github.com/acend/docsy-plus v1.2.0 // indirect
9+
github.com/google/docsy v0.11.0 // indirect
10+
github.com/google/docsy/dependencies v0.7.2 // indirect
1011
github.com/puzzle/docsy-puzzle v0.0.0-20230123144731-757054047a02 // indirect
12+
github.com/twbs/bootstrap v5.3.5+incompatible // indirect
1113
)

go.sum

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
2+
github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
3+
github.com/FortAwesome/Font-Awesome v0.0.0-20240716171331-37eff7fa00de h1:JvHOfdSqvArF+7cffH9oWU8oLhn6YFYI60Pms8M/6tI=
4+
github.com/FortAwesome/Font-Awesome v0.0.0-20240716171331-37eff7fa00de/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
25
github.com/acend/docsy-acend v0.0.0-20220406070448-8027986336dc h1:kNDPVcZCXsbJxqDstPoesa9YqWx84BVowj9cgxG6dnE=
36
github.com/acend/docsy-acend v0.0.0-20220406070448-8027986336dc/go.mod h1:92hTJB3aPssEooTK+gv0i84vwTjah30HKaLGdupJaPA=
7+
github.com/acend/docsy-acend v1.0.0 h1:TwmHoH3z6lh5zcNj6zUpMP4lYOhQ+OOgcbBwr7AqVoo=
48
github.com/acend/docsy-acend v1.0.0/go.mod h1:h8XZkPe1VufdOQfFXcLVQ7FvOJyIMKr8rJcSvWStG2g=
59
github.com/acend/docsy-plus v0.0.0-20220428195954-da462686a1f4 h1:NH8RTlmPMcTPxfZYlqYWWcqoQ5STebCQikKByJVRnAA=
610
github.com/acend/docsy-plus v0.0.0-20220428195954-da462686a1f4/go.mod h1:FUTTPmi3S92rVMbCYqXdGNxixdyqACBrFTK7dOuMttQ=
11+
github.com/acend/docsy-plus v1.2.0 h1:MJaMdkqXU6ws7A+6Lzhx4qGvncifund3NF44Tzs7iVM=
12+
github.com/acend/docsy-plus v1.2.0/go.mod h1:LPbI0Ljrhzt0YHUg8qozWVUXjrMVI1cFVPn3TyQxbcY=
713
github.com/google/docsy v0.4.0 h1:Eyt2aiDC1fnw/Qq/9xnIqUU5n5Yyk4c8gX3nBDdTv/4=
814
github.com/google/docsy v0.4.0/go.mod h1:vJjGkHNaw9bO42gpFTWwAUzHZWZEVlK46Kx7ikY5c7Y=
15+
github.com/google/docsy v0.11.0 h1:QnV40cc28QwS++kP9qINtrIv4hlASruhC/K3FqkHAmM=
16+
github.com/google/docsy v0.11.0/go.mod h1:hGGW0OjNuG5ZbH5JRtALY3yvN8ybbEP/v2iaK4bwOUI=
917
github.com/google/docsy/dependencies v0.4.0 h1:FXwyjtuFfPIPBauU2t7uIAgS6VYfJf+OD5pzxGvkQsQ=
1018
github.com/google/docsy/dependencies v0.4.0/go.mod h1:2zZxHF+2qvkyXhLZtsbnqMotxMukJXLaf8fAZER48oo=
19+
github.com/google/docsy/dependencies v0.7.2 h1:+t5ufoADQAj4XneFphz4A+UU0ICAxmNaRHVWtMYXPSI=
20+
github.com/google/docsy/dependencies v0.7.2/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4=
1121
github.com/puzzle/docsy-puzzle v0.0.0-20220406081603-2cd9f7c8d79a h1:ivuXhwliGTmfp4Zn9dqHiIHPUbniLhsbSYKrsQIoFKM=
1222
github.com/puzzle/docsy-puzzle v0.0.0-20220406081603-2cd9f7c8d79a/go.mod h1:FHtQEgHYfsiO5d1XXaF/mD5C51PQw1kea8JwTGBs93o=
23+
github.com/puzzle/docsy-puzzle v0.0.0-20230123144731-757054047a02 h1:80gTlzoKpnRjr4F70KAXmNs6UsTAkPgYEyyVguDwheg=
1324
github.com/puzzle/docsy-puzzle v0.0.0-20230123144731-757054047a02/go.mod h1:q4bPnnpLaz5IDdFmQFxCHr85uwAsK9ayut5NNmC4w3I=
1425
github.com/twbs/bootstrap v4.6.1+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
26+
github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
27+
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
28+
github.com/twbs/bootstrap v5.3.5+incompatible h1:6XrrFNMsiTTFcVTBf2886FO2XUNtwSE+QPv1os0uAA4=
29+
github.com/twbs/bootstrap v5.3.5+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

0 commit comments

Comments
 (0)