From dc91aa5ed99bfa2390924ff7ab0ca5b8f59cd54a Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 29 Apr 2026 13:29:26 +0200 Subject: Added git repository entry in main menu --- hugo.toml | 24 ++++++++++++++++++++---- i18n/en.yaml | 3 ++- i18n/it.yaml | 3 ++- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/hugo.toml b/hugo.toml index 2c94197..f9efca1 100644 --- a/hugo.toml +++ b/hugo.toml @@ -74,17 +74,25 @@ enableRobotsTXT = true name = "here" weight = 3 + [[languages.it.menus.main]] + identifier = "gitrepo" + url = "https://git.danix.xyz/" + name = "gitrepo" + weight = 4 + [languages.it.menus.main.params] + external = true + [[languages.it.menus.main]] identifier = "repository" pageRef = "/repository" name = "repo" - weight = 4 + weight = 5 [[languages.it.menus.main]] identifier = "legal" pageRef = "/is/legal" name = "legal" - weight = 5 + weight = 6 [languages.en] languageName = "EN" @@ -113,17 +121,25 @@ enableRobotsTXT = true name = "here" weight = 3 + [[languages.en.menus.main]] + identifier = "gitrepo" + url = "https://git.danix.xyz/" + name = "gitrepo" + weight = 4 + [languages.en.menus.main.params] + external = true + [[languages.en.menus.main]] identifier = "repository" pageRef = "/repository" name = "repo" - weight = 4 + weight = 5 [[languages.en.menus.main]] identifier = "legal" pageRef = "/is/legal" name = "legal" - weight = 5 + weight = 6 # Taxonomies [taxonomies] diff --git a/i18n/en.yaml b/i18n/en.yaml index bf35bb4..dcad3d2 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -3,7 +3,8 @@ home: "Home" articles: "Articles" about: "About" here: "Contact" -# repo: "Repo" +gitrepo: "Git Repository" +repo: "Repo" legal: "Privacy" language: "Language" toggleTheme: "Theme" diff --git a/i18n/it.yaml b/i18n/it.yaml index 31424ea..e0e7733 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -3,7 +3,8 @@ home: "Home" articles: "Articoli" about: "Chi Sono" here: "Contatti" -# repo: "Repo" +gitrepo: "Repository Git" +repo: "Repo" legal: "Privacy" language: "Lingua" toggleTheme: "Tema" -- cgit v1.2.3 From 15c7acd20849b13ab445ff8555ace5fb22a3ad7a Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 29 Apr 2026 13:32:15 +0200 Subject: docs: update WORKFLOW.md for production branch deploy + fix hugo.toml gitrepo params Co-Authored-By: Claude Sonnet 4.6 --- WORKFLOW.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/WORKFLOW.md b/WORKFLOW.md index 13a6da3..f142fcd 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -25,6 +25,8 @@ hugo new content/en/articles/my-new-article/index.md git add content/en/articles/my-new-article/ git commit -m "content: add article 'my-new-article'" git push origin master +# then deploy: +git checkout production && git merge master && git push origin production && git checkout master ``` ### Edit an existing article @@ -35,6 +37,8 @@ cd ~/Programming/GIT/danix.xyz-hacker-theme git add content/en/articles/my-article/index.md git commit -m "content: update 'my-article'" git push origin master +# then deploy: +git checkout production && git merge master && git push origin production && git checkout master ``` ### Delete an article @@ -44,6 +48,8 @@ cd ~/Programming/GIT/danix.xyz-hacker-theme git rm -r content/en/articles/my-article/ git commit -m "content: remove 'my-article'" git push origin master +# then deploy: +git checkout production && git merge master && git push origin production && git checkout master ``` ### Add a static asset (image, font, file) @@ -55,6 +61,8 @@ cp ~/Downloads/photo.jpg static/images/photo.jpg git add static/images/photo.jpg git commit -m "content: add photo.jpg" git push origin master +# then deploy: +git checkout production && git merge master && git push origin production && git checkout master ``` ### Update site config (hugo.toml, i18n strings) @@ -64,6 +72,8 @@ git push origin master git add hugo.toml git commit -m "config: ..." git push origin master +# then deploy: +git checkout production && git merge master && git push origin production && git checkout master ``` ### Mark an article as obsolete @@ -173,7 +183,7 @@ git push origin master ## Production Deployment -Pushing to `danix_git:danix.xyz-2` (master) triggers the `post-receive` hook on the server. +Pushing to `danix_git:danix.xyz-2` **production branch** triggers the `post-receive` hook on the server. Pushing to `master` alone does NOT deploy. The hook: 1. Creates a fresh Hugo site in `/tmp/danix.xyz-compile` @@ -182,11 +192,17 @@ The hook: 4. Runs `hugo -t dagreynix --minify` 5. Publishes to `/var/www/html` +**Deploy workflow:** commit to master first, then merge into production and push: + +```bash +git checkout production && git merge master && git push origin production && git checkout master +``` + **Important:** The hook always clones the current tip of the theme repo — it does NOT use the submodule pointer. This means: -- Pushing a theme change to `danix_git:danix2-hugo-theme` is enough for production to pick it up on the next content deploy. +- Pushing a theme change to `danix_git:danix2-hugo-theme` is enough for production to pick it up on the next deploy. - You do NOT need to bump the submodule pointer to deploy theme changes. The pointer is for local tracking only. -- If you want to deploy a theme change immediately without a content change, make any trivial commit in the content repo and push it. +- If you want to deploy a theme change immediately without a content change, make any trivial commit in the content repo, push to master, then merge to production. --- @@ -270,14 +286,17 @@ ssh danix_git "git -C ~/repositories/danix2-hugo-theme.git log --oneline | head # content change → deploy cd ~/Programming/GIT/danix.xyz-hacker-theme git add && git commit -m "..." && git push origin master +git checkout production && git merge master && git push origin production && git checkout master # theme change → deploy cd ~/Programming/GIT/danix2-hugo-theme # or themes/danix-xyz-hacker/ git checkout master git add && git commit -m "..." && git push origin master -# then bump pointer: +# then bump pointer in content repo: cd ~/Programming/GIT/danix.xyz-hacker-theme git add themes/danix-xyz-hacker && git commit -m "chore: bump theme" && git push origin master +# then deploy: +git checkout production && git merge master && git push origin production && git checkout master # check submodule status git submodule status -- cgit v1.2.3