Codeberg Pages
Codeberg allows you to publish static web content (HTML, images, etc) with a human-friendly address ({user-name}.codeberg.page).
Create a repository named 'pages' in your user account or organization.
Create static content, HTML, style, fonts or images. Name the homepage file 'index.html'
Push your content to the main branch of the new repository.
You should now be able to access your content using the domain '{user-name}.codeberg.page'.
See also https://codeberg.page/
See your link Codeberg Pages | Codeberg Documentation
That means the following:
- remove an existing
public
directory in your hugo repo - create a repo
pages
in your codeberg account - clone the repo pages into
public
(so that the root content ofpages
is in the “root” ofpublic
, no subfolder-games)
- create a bash script (
build.sh
for this sample) in your repo root and add the following code (what it does follows):
#!/bin/sh
hugo
cd public
git add -A
git commit -m "site update"
git push origin master
Make it executable and run if you want to upload changes to codeberg.
What it does:
- build the site
- add the site to your pages repo
- push them up
That should put the site online on username.codeberg.page.
You can optimize that regarding some points:
- remove existing built files in public before publishing hugo again (because if you use pipes then old files will clutter up your repo)
- add a nicer commit message for the site.
I remember having had a script that creates a github pages branch from a public directory, but I can’t find it. That might be easier than having the pages repo inside of your hugo repo.