From 42d472e35049a44e6393dfe8907d67e7448f5dc0 Mon Sep 17 00:00:00 2001 From: d3vyce Date: Sat, 24 Feb 2024 13:43:02 +0100 Subject: [PATCH] update: hugo migration article --- .../migrate-from-ghost-to-hugo/featured.png | 3 + .../migrate-from-ghost-to-hugo/featured.webp | 3 + .../img/image-1.png | 4 +- .../img/image-1.webp | 4 +- .../img/image-2.png | 4 +- .../img/image-2.webp | 4 +- .../img/image-3.png | 3 + .../img/image-3.webp | 3 + .../posts/migrate-from-ghost-to-hugo/index.md | 55 ++++++++++++++++--- .../featured.png | 3 + .../featured.webp | 3 + 11 files changed, 72 insertions(+), 17 deletions(-) create mode 100644 content/posts/migrate-from-ghost-to-hugo/featured.png create mode 100644 content/posts/migrate-from-ghost-to-hugo/featured.webp create mode 100644 content/posts/migrate-from-ghost-to-hugo/img/image-3.png create mode 100644 content/posts/migrate-from-ghost-to-hugo/img/image-3.webp create mode 100644 content/posts/uv-the-new-python-package-installer-written-in-rust/featured.png create mode 100644 content/posts/uv-the-new-python-package-installer-written-in-rust/featured.webp diff --git a/content/posts/migrate-from-ghost-to-hugo/featured.png b/content/posts/migrate-from-ghost-to-hugo/featured.png new file mode 100644 index 0000000..e771f2a --- /dev/null +++ b/content/posts/migrate-from-ghost-to-hugo/featured.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92baf31a4e2ee177aa84c6d87cbfc05f811f5e087bee33c5538d64d84c279df3 +size 163852 diff --git a/content/posts/migrate-from-ghost-to-hugo/featured.webp b/content/posts/migrate-from-ghost-to-hugo/featured.webp new file mode 100644 index 0000000..c4a16ae --- /dev/null +++ b/content/posts/migrate-from-ghost-to-hugo/featured.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f701aa206b49f366fd3b5b0bd25c223558e4b8d7d3a5e15d17cb214002c69c7a +size 41232 diff --git a/content/posts/migrate-from-ghost-to-hugo/img/image-1.png b/content/posts/migrate-from-ghost-to-hugo/img/image-1.png index 6da41c2..2237659 100644 --- a/content/posts/migrate-from-ghost-to-hugo/img/image-1.png +++ b/content/posts/migrate-from-ghost-to-hugo/img/image-1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f95546b5bce5aa0d006d140022f6a8a61bf792fa7f9487f15c7617aa5f698789 -size 12863 +oid sha256:94a6a5c7ee0a181f0e91eb0616c10fa9a68188eaa88393863cb022a2106bbd47 +size 309183 diff --git a/content/posts/migrate-from-ghost-to-hugo/img/image-1.webp b/content/posts/migrate-from-ghost-to-hugo/img/image-1.webp index 72b02ba..094ad85 100644 --- a/content/posts/migrate-from-ghost-to-hugo/img/image-1.webp +++ b/content/posts/migrate-from-ghost-to-hugo/img/image-1.webp @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aaa0fcf06ba055ed7ad3c989a3eccba7c4b4e00d118273f14dcc736bef4c8b23 -size 8750 +oid sha256:2e7746847bc7a2859fd03dac3517bfe3a62fbdcfb1c7aa8de8396bb66b744764 +size 53212 diff --git a/content/posts/migrate-from-ghost-to-hugo/img/image-2.png b/content/posts/migrate-from-ghost-to-hugo/img/image-2.png index 9c7ffbc..6da41c2 100644 --- a/content/posts/migrate-from-ghost-to-hugo/img/image-2.png +++ b/content/posts/migrate-from-ghost-to-hugo/img/image-2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ee74442892227fa52585be1ba435dab2447e047a670ea1be6d0090896e4d5f16 -size 10120 +oid sha256:f95546b5bce5aa0d006d140022f6a8a61bf792fa7f9487f15c7617aa5f698789 +size 12863 diff --git a/content/posts/migrate-from-ghost-to-hugo/img/image-2.webp b/content/posts/migrate-from-ghost-to-hugo/img/image-2.webp index 0f19a0c..72b02ba 100644 --- a/content/posts/migrate-from-ghost-to-hugo/img/image-2.webp +++ b/content/posts/migrate-from-ghost-to-hugo/img/image-2.webp @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bb268ac007d2b58d033aa7971fa899e01583142a93860d9f5013d23408ae76a2 -size 8522 +oid sha256:aaa0fcf06ba055ed7ad3c989a3eccba7c4b4e00d118273f14dcc736bef4c8b23 +size 8750 diff --git a/content/posts/migrate-from-ghost-to-hugo/img/image-3.png b/content/posts/migrate-from-ghost-to-hugo/img/image-3.png new file mode 100644 index 0000000..9c7ffbc --- /dev/null +++ b/content/posts/migrate-from-ghost-to-hugo/img/image-3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee74442892227fa52585be1ba435dab2447e047a670ea1be6d0090896e4d5f16 +size 10120 diff --git a/content/posts/migrate-from-ghost-to-hugo/img/image-3.webp b/content/posts/migrate-from-ghost-to-hugo/img/image-3.webp new file mode 100644 index 0000000..0f19a0c --- /dev/null +++ b/content/posts/migrate-from-ghost-to-hugo/img/image-3.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb268ac007d2b58d033aa7971fa899e01583142a93860d9f5013d23408ae76a2 +size 8522 diff --git a/content/posts/migrate-from-ghost-to-hugo/index.md b/content/posts/migrate-from-ghost-to-hugo/index.md index 663ecd4..1771697 100644 --- a/content/posts/migrate-from-ghost-to-hugo/index.md +++ b/content/posts/migrate-from-ghost-to-hugo/index.md @@ -14,6 +14,8 @@ I've had a blog since early 2022. Historically, I chose Ghost to make this site. - Simple, modern theme - Regular updates +![Ghost based blog](img/image-1.webp) + But after using it for quite some time, a number of problems have arisen that can't really be corrected: - Limited customization - Complex theme modification if you want to be able to update it afterwards @@ -59,6 +61,7 @@ git lfs migrate \ ### CI/CD +#### Hugo docker image hugo.Dockerfile: ```dockerfile FROM golang:1.22-alpine AS build @@ -70,14 +73,47 @@ ENV GO111MODULE=on RUN apk update && \ apk add --no-cache gcc musl-dev g++ git -RUN go install -tags extended github.com/gohugoio/hugo@v0.122.0 -``` -I then use the following commands to build the Hugo image: -``` -docker build -t git.d3vyce.fr/d3vyce/hugo:latest -f hugo.Dockerfile . -docker push git.d3vyce.fr/d3vyce/hugo:latest +RUN go install -tags extended github.com/gohugoio/hugo@v0.123.3 ``` + + +```yml +name: Build Hugo Docker Image + +on: + push: + paths: + - "hugo.Dockerfile" + +jobs: + build docker: + runs-on: linux_amd + steps: + - name: checkout code + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker registry + uses: docker/login-action@v2 + with: + registry: git.d3vyce.fr + username: ${{ github.actor }} + password: ${{ secrets.GIT_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./hugo.Dockerfile + platforms: linux/amd64 + push: true + tags: git.d3vyce.fr/d3vyce/hugo:latest + +``` + +#### Blog docker image Dockerfile: ```dockerfile # Build Stage @@ -86,7 +122,8 @@ FROM git.d3vyce.fr/d3vyce/hugo:latest AS build WORKDIR /opt/blog COPY . /opt/blog/ -RUN git submodule update --init --recursive +RUN git submodule update --init --recursive && \ + git -C themes/blowfish/ checkout v2.58.0 RUN hugo # Publish Stage @@ -149,10 +186,10 @@ Après avoir terminé la migration, j'ai comparé les 2 solutions. ### Performance Lighthouse result for Ghost based blog: -![Ghost based blog lighthouse result](img/image-1.webp) +![Ghost based blog lighthouse result](img/image-2.webp) Lighthouse result for Hugo based blog: -![Hugo based blog lighthouse result](img/image-2.webp) +![Hugo based blog lighthouse result](img/image-3.webp) | Metric | Ghost (Dawn) | Hugo (Blowfish) | |--------------------------|--------------|-----------------| diff --git a/content/posts/uv-the-new-python-package-installer-written-in-rust/featured.png b/content/posts/uv-the-new-python-package-installer-written-in-rust/featured.png new file mode 100644 index 0000000..e5522cd --- /dev/null +++ b/content/posts/uv-the-new-python-package-installer-written-in-rust/featured.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c6b2330966d9ea0a09430767a59f7044354fb610646930cf969ca861b20eda1 +size 1645920 diff --git a/content/posts/uv-the-new-python-package-installer-written-in-rust/featured.webp b/content/posts/uv-the-new-python-package-installer-written-in-rust/featured.webp new file mode 100644 index 0000000..7229ae4 --- /dev/null +++ b/content/posts/uv-the-new-python-package-installer-written-in-rust/featured.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54434a94f821540fb5f0efdedafb99d8a33b06d80a5e550bf189d2dc9284068c +size 232424