From 3f087ded011b741d6b0c70c8444923e074e424eb Mon Sep 17 00:00:00 2001 From: bojemoi Date: Fri, 6 Feb 2026 19:56:10 +0100 Subject: [PATCH] Initial Hugo site with Gitea Actions deploy workflow --- .gitea/workflows/hugo-deploy.yml | 23 +++++++++++++++++++++++ archetypes/default.md | 5 +++++ content/_index.md | 5 +++++ content/posts/premier-article.md | 15 +++++++++++++++ hugo.toml | 10 ++++++++++ layouts/_default/baseof.html | 21 +++++++++++++++++++++ layouts/_default/list.html | 12 ++++++++++++ layouts/_default/single.html | 9 +++++++++ layouts/index.html | 12 ++++++++++++ static/css/style.css | 11 +++++++++++ 10 files changed, 123 insertions(+) create mode 100644 .gitea/workflows/hugo-deploy.yml create mode 100644 archetypes/default.md create mode 100644 content/_index.md create mode 100644 content/posts/premier-article.md create mode 100644 hugo.toml create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/index.html create mode 100644 static/css/style.css diff --git a/.gitea/workflows/hugo-deploy.yml b/.gitea/workflows/hugo-deploy.yml new file mode 100644 index 0000000..441f168 --- /dev/null +++ b/.gitea/workflows/hugo-deploy.yml @@ -0,0 +1,23 @@ +name: Hugo Build & Deploy +on: + push: + branches: [main] + +jobs: + build-deploy: + runs-on: ubuntu-latest + container: + image: klakegg/hugo:ext-alpine + volumes: + - /var/www/blog.bojemoi.me:/deploy + steps: + - uses: actions/checkout@v4 + + - name: Build Hugo site + run: hugo --minify + + - name: Deploy to web root + run: | + rm -rf /deploy/* + cp -r public/* /deploy/ + echo "Deployed $(date -u '+%Y-%m-%d %H:%M:%S UTC')" > /deploy/.deployed diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..43dca9a --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ +--- +title: "{{ replace .File.ContentBaseName "-" " " | title }}" +date: {{ .Date }} +draft: true +--- diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..22e2061 --- /dev/null +++ b/content/_index.md @@ -0,0 +1,5 @@ +--- +title: "Accueil" +--- + +Bienvenue sur le blog de Bojemoi Lab. diff --git a/content/posts/premier-article.md b/content/posts/premier-article.md new file mode 100644 index 0000000..e0a5708 --- /dev/null +++ b/content/posts/premier-article.md @@ -0,0 +1,15 @@ +--- +title: "Premier article" +date: 2026-02-06 +draft: false +--- + +Bienvenue sur le blog Bojemoi Lab. + +Ce blog est automatiquement buildé et déployé via **Gitea Actions** et **Hugo**. + +## Stack technique + +- **Hugo** pour la génération de site statique +- **Gitea Actions** + `act_runner` pour le CI/CD +- **Nginx** + Let's Encrypt pour le serving HTTPS diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..37b4346 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,10 @@ +baseURL = 'https://blog.bojemoi.me/' +languageCode = 'fr' +title = 'Bojemoi Blog' +theme = '' + +[params] + description = "Blog technique - Bojemoi Lab" + +[markup.goldmark.renderer] + unsafe = true diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..2138a75 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,21 @@ + + + + + + {{ block "title" . }}{{ .Site.Title }}{{ end }} + + + +
+

{{ .Site.Title }}

+

{{ .Site.Params.description }}

+
+
+ {{ block "main" . }}{{ end }} +
+ + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..6e6252f --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,12 @@ +{{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }} +{{ define "main" }} +

{{ .Title }}

+ {{ .Content }} + {{ range .Pages }} +
+

{{ .Title }}

+ +

{{ .Summary }}

+
+ {{ end }} +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..86c3141 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,9 @@ +{{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }} +{{ define "main" }} +
+

{{ .Title }}

+ + {{ .Content }} +
+ ← Retour +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..d9b2aba --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,12 @@ +{{ define "title" }}{{ .Site.Title }}{{ end }} +{{ define "main" }} + {{ .Content }} +

Articles

+ {{ range site.RegularPages }} +
+

{{ .Title }}

+ +

{{ .Summary }}

+
+ {{ end }} +{{ end }} diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..e4d0ea2 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,11 @@ +* { margin: 0; padding: 0; box-sizing: border-box; } +body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.6; max-width: 800px; margin: 0 auto; padding: 2rem; color: #333; } +header { margin-bottom: 2rem; border-bottom: 2px solid #eee; padding-bottom: 1rem; } +header h1 a { color: #333; text-decoration: none; } +header p { color: #666; } +article { margin-bottom: 2rem; } +article h3 a { color: #0066cc; text-decoration: none; } +article h3 a:hover { text-decoration: underline; } +article time { color: #999; font-size: 0.9rem; } +footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #eee; color: #999; font-size: 0.85rem; } +h2 { margin: 1.5rem 0 1rem; }