I have my simple web page with blog running locally on HUGO server - as a container.
Now it is time to make it public…
What I want?
- Generate code for my web page
- Setup workflow for publishing
- And finally see my page on internet :)
Primary goal of HUGO, as static site generator, is simply generate html, css and js code for web site.
And next step is very easy. Just attach shell to container and type hugo
.
docker exec -it hugo_2025-server-1 bash
hugo
Now I have complete code generated in /public
folder of my sbezo.github.io
project.
And I need to get it to github server.
First a little bit a git woodoo ;)
I have already git initiated in parent folder HUGO
of my site folder sbezo.github.io
.
public
folder is inside site.
Simply something like this:
π HUGO
βββ π .gitignore
βββ π docker-compose.yml
βββ π .git/
βββ π sbezo.github.io/
βββ π public/
βββ π content/
βββ π content/
βββ π ...
βββ π hugo.yaml
As I want to push complete HUGO
folder as private repository to github.com, I did it in VSCode as usually. Nothing special to explain.
But I also want to push /public
folder as public repository to one special github repository with name sbezo/sbezo.github.io
.
Each Github user can publish static web content from this special repository with name
username/username.github.io
and can be served onhttps://username.github.io
for free.
So I excluded /public
from git by modifying .gitignore
file under HUGO
folder by adding record:
sbezo.github.io/public
And then I initialized another git inside /public/
folder and push repository to remote.
cd public
git init
git add *
git commit -m "1st commit"
git remote add origin git@github.com:sbezo/sbezo.github.io.git
git push origin main --force
I had repository
sbezo/sbezo.github.io
already on github.com with some obsolete data.
Small tunning on github repository under Settings > Pages is necessary:
.
Also some changes in VSCode to see both repositories in Source Control are necessary:
- go to
File > Add Folder to Workspaceβ¦
- Select the
public/
folder - go to
File > Save Workspace As
Both repositories should be open as Workspace next time
Final workflow
- Create new post with HUGO
docker compose up
docker exec -it hugo_2025-server-1 bash
hugo new posts/My_new_post.md
-
Edit
My_new_post.md
as needed -
Generate new content for web site
docker exec -it hugo_2025-server-1 bash
hugo
- Commit and push both repositories to remote github.com from VSCode. First public, then HUGO
Result
Now I have a my simple personal website running on internet.
I do not claim, that it is perfectly correct setup. But it is most logic for me and it works !. I hope it could helps somebody else…