Skip to content

DavidFarrell/ecologygames.eu

Repository files navigation

ecologygames.eu

A news site built with Hugo using the Pehtheme-Hugo theme.

Quick Start

  1. Install required software:

    • Hugo (v0.116.0 or higher)
    • NodeJS (for Tailwind CSS)
  2. Install Node dependencies:

    npm install

Local Development

There are two main ways to run the site locally, depending on what you're working on:

  1. 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)
  2. 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

Creating New Posts

Use the hugo-new.sh script to create new posts:

  1. Basic usage (creates post with current date):

    ./hugo-new.sh "Your Post Title"
  2. 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)

Production Build and Deployment

  1. Local Build:

    npm run build

    This command:

    • Processes Tailwind CSS
    • Builds Hugo site
    • Output goes to /public
  2. 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.

  3. 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

Site Configuration

Edit hugo.toml for site settings:

About

A website about games about ecology

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages