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
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
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)
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)
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
## 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`
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.
---
# content change → deploy
cd ~/Programming/GIT/danix.xyz-hacker-theme
git add <files> && 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 <files> && 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