I look that Codeberg (a german git hosting) has the feature for to publish static web content. But the service seems very simple, I’ve searching on his web and I can’t find personal projects that use Hugo. The majority of webs use vanilla html + css (and some js).
As there are some really beautiful themes of Hugo in many places, I will like to use some of them on Codeberg, but it isn’t like Github or Gitlab so, How to use a Hugo theme with Codeberg Page service?
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/
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 of pages is in the “root” of public, 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.