Overview
With a private Git server already running (see the previous video), it’s time to scaffold the actual Hugo site and get it under version control. This guide covers initializing a new Hugo project, adding a theme, and pushing the first commit to your self-hosted Gitea instance.
Hardware / Requirements
- Gitea already installed and running (see my Private Git Server with Gitea on Proxmox guide if you haven’t set this up yet).
- Hugo (extended version) installed on your local machine.
- Git installed locally.
🌐 Prerequisite: You’ll need an empty repository already created on your Gitea instance before the final step below.
Procedure
Step 1: Scaffold the Hugo Site
- Open a terminal on your local machine.
- Run
hugo new site homelablogto create the project skeleton. cdinto the new project folder.- Add a theme as a Git submodule (e.g. PaperMod) under the
themes/directory. - Reference the theme in your
hugo.tomlconfiguration file.
Step 2: Initialize Git and Make the First Commit
- Run
git initinside the project folder. - Add a
.gitignorefile to exclude thepublic/andresources/build folders. - Stage all files with
git add .. - Commit with a clear first message, e.g.
git commit -m "Initial Hugo site scaffold".
Step 3: Push to Gitea
- In your Gitea web UI, create a new empty repository (no README, no license) named
homelablog. - Copy the repository’s remote URL from Gitea.
- Add it as a remote:
git remote add origin <your-gitea-repo-url>. - Push your first commit:
git push -u origin main. - Refresh the Gitea repo page to confirm your Hugo project is now versioned and backed up on your own server.