A news site built with Hugo using the Pehtheme-Hugo theme.
-
Install required software:
- Hugo (v0.116.0 or higher)
- NodeJS (for Tailwind CSS)
-
Install Node dependencies:
npm install
There are two main ways to run the site locally, depending on what you're working on:
-
For content development and general testing:
hugo server -D --disableFastRender --poll 500ms
This command:
- Starts the Hugo server (localhost:1313)
-D
: Includes draft posts--disableFastRender
: Ensures full page rebuilds for accurate previews--poll 500ms
: Watches for file changes every 500ms (more reliable than default)
-
For Tailwind CSS development:
npm run dev
Only use this command when actively working on Tailwind CSS styles. It:
- Starts the Hugo server
- Watches for Tailwind CSS changes
- Processes CSS changes in real-time
Use the hugo-new.sh
script to create new posts:
-
Basic usage (creates post with current date):
./hugo-new.sh "Your Post Title"
-
With custom date (supports both YYMMDD and YYYYMMDD formats):
./hugo-new.sh -d 241205 "Your Post Title" # or ./hugo-new.sh -d 20241205 "Your Post Title"
The script will:
- Create a new markdown file in
content/posts/YEAR/
- Add the date prefix to the filename (MM-DD-title)
- Preserve original title capitalization in the frontmatter
- Set the post date (current or specified)
-
Local Build:
npm run build
This command:
- Processes Tailwind CSS
- Builds Hugo site
- Output goes to /public
-
Commit the changes:
git add . git commit -m "Update site content" git push origin main
Important: The /public directory must be committed as it contains the built site.
-
Deployment:
- The site automatically deploys to GitHub Pages when changes are pushed to main
- The deployment uses the pre-built files from the /public directory
- No build process runs on GitHub - only deployment
- Site becomes available at ecologygames.eu
Edit hugo.toml for site settings: