2.3 KiB
2.3 KiB
Hugo Site for Coolify Deployment
This is a basic Hugo static site, ready to be deployed on Coolify using Nixpacks.
Prerequisites
- A Coolify instance (self-hosted or cloud).
- This Git repository connected to your Coolify instance.
- Hugo installed locally if you want to develop and test the site before pushing changes (optional but recommended). You can download Hugo from gohugo.io.
Deployment Steps on Coolify
- Add a New Resource: In your Coolify dashboard, go to your project and add a new resource.
- Select Source: Choose "Git Repository".
- Configure Git:
- Select your Git provider and repository.
- Choose the branch you want to deploy (e.g.,
mainormaster).
- Build Configuration:
- Build Pack: Select
Nixpacks. - Type: Choose
Static Site.
- Build Pack: Select
- Settings:
- Build Command:
hugo - Publish Directory:
public - (Coolify might auto-detect these for Hugo with Nixpacks, but it's good to confirm.)
- Build Command:
- Save and Deploy: Save your configuration and trigger a deployment.
Coolify will then use Nixpacks to build your Hugo site (by running the hugo command) and serve it from the public directory.
Local Development (Optional)
- Clone this repository.
- Install Hugo (if not already installed).
- Navigate to the project directory in your terminal.
- Run
hugo server -Dto start the local development server. - Open your browser to
http://localhost:1313(or the port shown in the terminal).
Project Structure
hugo.toml: Main Hugo configuration.content/: Your site's content (Markdown files).layouts/: Your site's templates (HTML files). (Create this if you want to customize the theme or create your own).static/: Static assets like images, CSS, JS. (Create this for your assets).themes/: Where Hugo themes are typically placed. (Create this if you add a theme).public/: The output directory where Hugo builds the static site. This directory is usually not committed to Git. Coolify will generate it during the build process.
Remember to add a theme to your hugo.toml and place it in the themes folder, or build your own layouts in the layouts folder to see more than just plain HTML.