Skip to content

Commit

Permalink
feat: migrate from git submodule to hugo module
Browse files Browse the repository at this point in the history
  • Loading branch information
verysonglaa committed Jul 31, 2023
1 parent 1c61489 commit e6e126f
Show file tree
Hide file tree
Showing 18 changed files with 41,139 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public
.vscode
*.iml
target
.hugo_build.lock

# eclipse
.classpath
Expand Down
9 changes: 0 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +0,0 @@
[submodule "themes/docsy"]
path = themes/docsy
url = https://github.com/google/docsy.git
[submodule "themes/docsy-plus"]
path = themes/docsy-plus
url = https://github.com/acend/docsy-plus.git
[submodule "themes/docsy-puzzle"]
path = themes/docsy-puzzle
url = https://github.com/puzzle/docsy-puzzle.git
37 changes: 32 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
FROM klakegg/hugo:0.87.0-ext-ubuntu AS builder
FROM klakegg/hugo:0.111.3-ext-ubuntu AS builder

ARG HUGO_ENV=default
ARG TRAINING_HUGO_ENV=default

COPY . /src

RUN hugo --environment ${HUGO_ENV} --minify
RUN hugo --environment ${TRAINING_HUGO_ENV} --minify

FROM nginxinc/nginx-unprivileged:alpine
RUN apt-get update \
&& apt-get install -y imagemagick

RUN find /src/public/docs/ -regex '.*\(jpg\|jpeg\|png\|gif\)' -exec mogrify -path /src/public/pdf -resize 800\> -unsharp 0.25x0.25+8+0.065 "{}" \;
RUN find /src/public/docs/ -regex '.*\(jpg\|jpeg\|png\|gif\)' -exec mogrify -path /src/public -resize 800\> -unsharp 0.25x0.25+8+0.065 "{}" \;

FROM ubuntu:jammy AS wkhtmltopdf
RUN apt-get update \
&& apt-get install -y curl \
&& 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 \
&& ls -la \
&& apt-get install -y /wkhtmltox_0.12.6.1-2.jammy_amd64.deb \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /wkhtmltox_0.12.6.1-2.jammy_amd64.deb

COPY --from=builder /src/public /

RUN wkhtmltopdf --enable-internal-links --enable-local-file-access \
--margin-top 35mm --margin-bottom 22mm --margin-left 15mm --margin-right 10mm \
--enable-internal-links --enable-local-file-access \
--header-html /pdf/header/index.html --footer-html /pdf/footer/index.html \
--dpi 600 \
/pdf/index.html /pdf.pdf

FROM nginxinc/nginx-unprivileged:1.25-alpine

LABEL maintainer acend.ch

EXPOSE 8080

COPY --from=builder /src/public /usr/share/nginx/html
COPY --from=builder /src/public /usr/share/nginx/html
COPY --from=wkhtmltopdf /pdf.pdf /usr/share/nginx/html/pdf/pdf.pdf
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ Docsy is being enhanced using [docsy-plus](https://github.com/acend/docsy-plus/)
[docsy-acend](https://github.com/acend/docsy-acend/) and [docsy-puzzle](https://github.com/puzzle/docsy-puzzle/)
for brand specific settings.

After cloning the main repo, you need to initialize the submodule like this:

```bash
git submodule update --init --recursive
```

The default configuration uses the puzzle setup from [config/_default](config/_default/config.toml).
Further, specialized environments can be added in the `config` directory.
Expand Down
20 changes: 18 additions & 2 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title = "Microservices Lab"

enableGitInfo = true

theme = ["docsy-puzzle", "docsy-plus", "docsy"]

languageCode = "en-us"

contentDir = "content/en"
Expand Down Expand Up @@ -135,3 +133,21 @@ url = "https://twitter.com/puzzleitc"
name = "LinkedIn"
icon = "fab fa-linkedin-in"
url = "https://www.linkedin.com/company/puzzle-itc/"


[module]
[module.hugoVersion]
extended = true
min = "0.100.0"
[[module.imports]]
path = "github.com/acend/docsy-acend"
disable = false
[[module.imports]]
path = "github.com/acend/docsy-plus"
disable = false
[[module.imports]]
path = "github.com/google/docsy"
disable = false
[[module.imports]]
path = "github.com/google/docsy/dependencies"
disable = false
2 changes: 2 additions & 0 deletions content/en/docs/04/part/44.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,5 @@ public void confirmOrder(Long id) {
shopOrder.persistAndFlush();
}
```
{{% /details %}}

10 changes: 10 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module github.com/puzzle/microservices-lab

go 1.20

require (
github.com/acend/docsy-acend v0.0.0-20230301101952-9253f0a31c68 // indirect
github.com/acend/docsy-plus v0.0.0-20230303095323-1af8d88aadc7 // indirect
github.com/google/docsy v0.4.0 // indirect
github.com/google/docsy/dependencies v0.4.0 // indirect
)
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/acend/docsy-acend v0.0.0-20230301101952-9253f0a31c68 h1:trqoLzVYYvjHqexqpuqNzObHdJ3oSP6EqWfl3w/nPPE=
github.com/acend/docsy-acend v0.0.0-20230301101952-9253f0a31c68/go.mod h1:h8XZkPe1VufdOQfFXcLVQ7FvOJyIMKr8rJcSvWStG2g=
github.com/acend/docsy-plus v0.0.0-20230303095323-1af8d88aadc7 h1:gqzupsXEHLIk9fHmglX6Ob2gCXV/zf0ZYU9ksvqsWAo=
github.com/acend/docsy-plus v0.0.0-20230303095323-1af8d88aadc7/go.mod h1:YDHqf+DCZcx5HvKGzaBluPmLfgHQ2GKkYjggvF98jR4=
github.com/google/docsy v0.2.0-pre.0.20220321183617-02df04c0f2d4 h1:3i0I8OLTVLpi5zvIbqFbx2i2uDj/xMktxn8vo3zH68w=
github.com/google/docsy v0.2.0-pre.0.20220321183617-02df04c0f2d4/go.mod h1:yuKLZHMX5CKiLUH55+ePFJaYnoSwUVVffNareaOGQYo=
github.com/google/docsy v0.4.0 h1:Eyt2aiDC1fnw/Qq/9xnIqUU5n5Yyk4c8gX3nBDdTv/4=
github.com/google/docsy v0.4.0/go.mod h1:vJjGkHNaw9bO42gpFTWwAUzHZWZEVlK46Kx7ikY5c7Y=
github.com/google/docsy/dependencies v0.2.0-pre/go.mod h1:oPdn05sNt61uT6K+LqNRhYq1jeqrsbbQMDXkPdPscmA=
github.com/google/docsy/dependencies v0.2.0-pre.0.20220321183617-02df04c0f2d4 h1:EKYx2OlWxo2HBhZ+dWzZbufBfh+qMKmz2K1lf1GJmto=
github.com/google/docsy/dependencies v0.2.0-pre.0.20220321183617-02df04c0f2d4/go.mod h1:oPdn05sNt61uT6K+LqNRhYq1jeqrsbbQMDXkPdPscmA=
github.com/google/docsy/dependencies v0.4.0 h1:FXwyjtuFfPIPBauU2t7uIAgS6VYfJf+OD5pzxGvkQsQ=
github.com/google/docsy/dependencies v0.4.0/go.mod h1:2zZxHF+2qvkyXhLZtsbnqMotxMukJXLaf8fAZER48oo=
github.com/twbs/bootstrap v4.6.1+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
Loading

0 comments on commit e6e126f

Please sign in to comment.