Compare commits

...

9 Commits

Author SHA1 Message Date
e835486965 change: add HUGO_DEST and remove metrics
Some checks failed
Deploy / Deploy (push) Failing after 3s
2025-06-02 13:04:51 +00:00
4d1a265b9d fix: change verbose to logLevel
All checks were successful
Deploy / Deploy (push) Successful in 3s
2025-06-02 12:58:32 +00:00
c05ccae7ff change: harden hugo page generation
All checks were successful
Deploy / Deploy (push) Successful in 4s
2025-06-02 12:56:18 +00:00
82170a7ee5 add: index.json layout
All checks were successful
Deploy / Deploy (push) Successful in 3s
2025-06-02 12:52:40 +00:00
31ab29ccbb remove: unused themes PaperMod and hugo-coder
All checks were successful
Deploy / Deploy (push) Successful in 3s
2025-06-02 11:28:37 +02:00
687595b4c9 fix: add recurse-submodules in the git clone
All checks were successful
Deploy / Deploy (push) Successful in 4s
2025-06-02 09:21:09 +00:00
51a5046f3c fix: change image base from alpine to stable
All checks were successful
Deploy / Deploy (push) Successful in 4s
2025-06-02 08:38:52 +00:00
b9b4d0bf8b add: docker folder for image build
All checks were successful
Deploy / Deploy (push) Successful in 6s
2025-06-02 08:02:23 +00:00
Gitea Actions
6b194c5069 Auto-update blog content from Obsidian: 2025-06-01 18:48:25
All checks were successful
Deploy / Deploy (push) Successful in 4s
2025-06-01 18:48:25 +00:00
8 changed files with 85 additions and 6 deletions

6
.gitmodules vendored
View File

@ -1,9 +1,3 @@
[submodule "themes/hugo-coder"]
path = themes/hugo-coder
url = https://github.com/luizdepra/hugo-coder.git
[submodule "themes/PaperMod"]
path = themes/PaperMod
url = https://github.com/adityatelange/hugo-PaperMod.git
[submodule "themes/stack"] [submodule "themes/stack"]
path = themes/stack path = themes/stack
url = https://github.com/CaiJimmy/hugo-theme-stack.git url = https://github.com/CaiJimmy/hugo-theme-stack.git

View File

@ -58,6 +58,8 @@ L'idée est simple :
De cette façon, je n'ai plus besoin de copier manuellement de fichiers ni de gérer les déploiements. Tout se déroule, de l'écriture de Markdown dans Obsidian au déploiement complet du site web. De cette façon, je n'ai plus besoin de copier manuellement de fichiers ni de gérer les déploiements. Tout se déroule, de l'écriture de Markdown dans Obsidian au déploiement complet du site web.
![Workflow depuis l'écriture de notes sur Obsidian au Blog publié](img/obsidian-blog-gitea-actions-workflow.png)
--- ---
## ⚙️ Implémentation ## ⚙️ Implémentation

View File

@ -57,6 +57,8 @@ The idea is simple:
This way, I never need to manually copy files or trigger deployments. Everything flows from writing markdown in Obsidian to having a fully deployed website. This way, I never need to manually copy files or trigger deployments. Everything flows from writing markdown in Obsidian to having a fully deployed website.
![Workflow depuis l'écriture de notes sur Obsidian au Blog publié](img/obsidian-blog-gitea-actions-workflow.png)
--- ---
## ⚙️ Implementation ## ⚙️ Implementation

28
docker/Dockerfile Normal file
View File

@ -0,0 +1,28 @@
FROM nginx:stable
ARG HUGO_VERSION
ENV HUGO_VERSION=${HUGO_VERSION}
ENV HUGO_DEST=/usr/share/nginx/html
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Download Hugo
RUN curl -sSL https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz \
| tar -xz -C /usr/local/bin hugo
# Add entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Nginx serves on port 80
EXPOSE 80
# Set default entrypoint
ENTRYPOINT ["/entrypoint.sh"]

16
docker/entrypoint.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e
# Configuration
REPO_URL="${REPO_URL:-https://git.vezpi.me/Vezpi/blog.git}"
BRANCH="${BRANCH:-preview}"
CLONE_DIR="${CLONE_DIR:-/blog}"
echo "- Cloning $REPO_URL (branch: $BRANCH)..."
git clone --depth 1 --recurse-submodules --branch "$BRANCH" "$REPO_URL" "$CLONE_DIR"
echo "- Building site with Hugo v$HUGO_VERSION in $HUGO_DEST..."
hugo --source "$CLONE_DIR" --destination "$HUGO_DEST" --logLevel info --cleanDestinationDir --gc --panicOnWarning --printI18nWarnings
echo "- Starting Nginx..."
exec nginx -g 'daemon off;'

26
docker/nginx.conf Normal file
View File

@ -0,0 +1,26 @@
map $http_accept_language $lang {
default en;
~fr fr;
}
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Redirect users to their language home page
rewrite ^/$ /$lang/ redirect;
location / {
try_files $uri $uri/ =404;
}
# Custom 404 page
error_page 404 /$lang/404.html;
location = /$lang/404.html {
internal;
}
}

11
layouts/index.json.json Normal file
View File

@ -0,0 +1,11 @@
{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- $.Scratch.Add "index" (dict
"title" .Title
"permalink" .Permalink
"summary" .Summary
"tags" .Params.tags
"date" (.Date.Format "2006-01-02")
) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB