Files
chill.social/themes/chill-theme/docs/INSTALLATION.md
2026-01-28 09:40:37 +01:00

14 KiB

Installation Guide

Complete guide to installing and setting up the Hugo Saasify Theme for your SaaS website.

Table of Contents

Prerequisites

Before installing the Hugo Saasify Theme, ensure you have the following installed on your system:

Required Software

  1. Hugo Extended (v0.80.0 or later)

    • The theme requires Hugo Extended edition for Tailwind CSS processing
    • Download from Hugo Releases
    • Verify installation: hugo version
    • Expected output should include "extended"
  2. Git (latest version recommended)

    • Required for theme installation and updates
    • Download from git-scm.com
    • Verify installation: git --version
  3. Node.js and npm (v14.0.0 or later)

    • Required for Tailwind CSS compilation
    • Download from nodejs.org
    • Verify installation: node --version and npm --version

System Requirements

  • Operating System: Windows, macOS, or Linux
  • Disk Space: At least 100MB free
  • Internet Connection: Required for initial setup and dependencies
  • Code editor (VS Code, Sublime Text, or similar)
  • Terminal/Command line familiarity
  • Basic understanding of Hugo and Markdown

Installation Methods

Choose the installation method that best fits your use case.

Method 1: New Site

This is the recommended method if you're starting a new project from scratch.

Step 1: Create a New Hugo Site

# Create a new Hugo site
hugo new site my-saas-website

# Navigate into the new site directory
cd my-saas-website

Step 2: Initialize Git Repository

# Initialize git repository
git init

# Create initial commit
git add .
git commit -m "Initial commit"

Step 3: Add the Theme as a Git Submodule

# Add theme as submodule
git submodule add https://github.com/chaoming/chill-theme.git themes/chill-theme

# Update submodule
git submodule update --init --recursive

Step 4: Example Site (Optional)

The theme comes with a fully functional example site that demonstrates its features and capabilities. You can use this as a reference when building your own site.

Using the Example Site

The example site provides a great starting point to understand how to:

  • Structure your content
  • Use different page layouts
  • Configure navigation menus
  • Set up site parameters
  • Implement common SaaS website features
  1. Copy the example site content:
cp -r themes/chill-theme/exampleSite/* .

The example site includes:

  • Complete content structure with sample pages
  • Blog posts with various layouts
  • Feature pages
  • Career/Jobs section
  • Pricing page
  • Company information page
  • Properly configured hugo.toml

Step 5: Install Dependencies

# Copy package.json and other config files to your site root
cp themes/chill-theme/package.json .
cp themes/chill-theme/postcss.config.js .
cp themes/chill-theme/tailwind.config.copy.js ./tailwind.config.js
# Install dependencies
npm install

Step 6: Set the theme in hugo.toml

Open your hugo.toml and check that the theme is correctly set:

# Theme Configuration
theme = "chill-theme"

Step 7: Start Development Server

# Start development server (builds TailwindCSS and runs Hugo server)
npm run start

# Your site will be available at http://localhost:1313

Method 2: Existing Site

If you already have a Hugo site and want to add the Saasify theme.

Step 1: Add Theme as Submodule

# From your site root directory
git submodule add https://github.com/chaoming/chill-theme.git themes/chill-theme

# Update submodule
git submodule update --init --recursive

Step 2: Update Configuration

Add or update the following in your hugo.toml:

theme = "chill-theme"

# Required Features
pygmentsCodeFences = true
pygmentsUseClasses = true
enableEmoji = true
enableGitInfo = true

# Required Module Configuration
[module]
  [module.hugoVersion]
    extended = true
    min = "0.80.0"

# Required Build Configuration
[build]
  writeStats = true

# Required Markup Configuration
[markup]
  [markup.highlight]
    noClasses = false
    lineNos = true
    codeFences = true
  [markup.goldmark.renderer]
    unsafe = true
  [markup.tableOfContents]
    endLevel = 3
    ordered = false
    startLevel = 2

Step 3: Install Theme Dependencies

# Copy package.json and other config files to your site root
cp themes/chill-theme/package.json .
cp themes/chill-theme/postcss.config.js .
cp themes/chill-theme/tailwind.config.copy.js ./tailwind.config.js

# Install dependencies
npm install

Step 4: Configure Theme Settings

Copy relevant configuration from the example site:

# View example configuration for reference
cat themes/chill-theme/exampleSite/hugo.toml

Merge the configuration settings into your existing hugo.toml. See CONFIGURATION.md for detailed options.

Step 5: Test the Theme

# Start development server
npm run start

Method 3: Manual Installation

For users who prefer not to use Git submodules or need more control over the installation.

Step 1: Download Theme

# Download and extract theme
curl -L https://github.com/chaoming/chill-theme/archive/refs/heads/main.zip -o theme.zip
unzip theme.zip
mv chill-theme-main themes/chill-theme
rm theme.zip

Alternatively, download the ZIP file from GitHub and extract it manually to themes/chill-theme.

Step 2: Install Dependencies

# Copy package.json and other config files to your site root
cp themes/chill-theme/package.json .
cp themes/chill-theme/postcss.config.js .
cp themes/chill-theme/tailwind.config.copy.js ./tailwind.config.js

# Install dependencies
npm install

Step 3: Configure Hugo

Update your hugo.toml to reference the theme:

theme = "chill-theme"

Add all required configuration settings from the example site.

Step 4: Verify Installation

# Check theme is recognized
hugo config

# Start development server
npm run start

Initial Configuration

After installing the theme, configure the essential settings.

Basic Configuration

Edit your hugo.toml file:

# Basic Configuration
baseURL = "/"
languageCode = "en-us"
title = "Your Site Title"
theme = "chill-theme"

# Required Features
pygmentsCodeFences = true  # Enable syntax highlighting
pygmentsUseClasses = true
enableEmoji = true        # Enable emoji support
enableGitInfo = true      # Enable Git info for lastmod

# Required Module Configuration
[module]
  [module.hugoVersion]
    extended = true
    min = "0.80.0"

# Required Build Configuration
[build]
  writeStats = true      # Required for TailwindCSS

# Required Markup Configuration
[markup]
  [markup.highlight]
    noClasses = false
    lineNos = true
    codeFences = true
  [markup.goldmark.renderer]
    unsafe = true       # Allow HTML in markdown
  [markup.tableOfContents]
    endLevel = 3
    ordered = false
    startLevel = 2

# Theme Parameters
[params]
  description = "Your site description"
  author = "Your Name"
  logo = "/images/logo.svg"

Tailwind CSS Setup

The theme uses Tailwind CSS for styling. The build process is integrated into Hugo.

During installation, you should have copied the Tailwind configuration file:

  • tailwind.config.js - Copied from themes/chill-theme/tailwind.config.copy.js to your site root
  • postcss.config.js - PostCSS configuration in your site root
  • Dependencies installed via npm install

The npm run start command automatically watches and compiles Tailwind CSS during development.

Menu Configuration

Add your navigation menu to hugo.toml:

[menu]
  [[menu.main]]
    name = "Features"
    weight = 1
    [menu.main.params]
      has_submenu = true
      submenu = [
        { name = "Feature 1", url = "/features/feature-1/" },
        { name = "Feature 2", url = "/features/feature-2/" }
      ]

  [[menu.main]]
    name = "Pricing"
    url = "/pricing"
    weight = 2

  [[menu.main]]
    name = "Blog"
    url = "/blog"
    weight = 3

See CONFIGURATION.md for complete menu options.

Verifying Installation

Check Hugo Version

hugo version

Expected output should include "extended" and version 0.80.0 or higher.

Check Theme Files

# Verify theme directory structure
ls -la themes/chill-theme/

# Should show:
# - layouts/
# - assets/
# - static/
# - exampleSite/
# - package.json
# - tailwind.config.js

Test Development Server

# Start server
npm run start

# Check for errors in terminal
# Visit http://localhost:1313 in browser

Verify Build Output

# Build site
hugo

# Check public directory was created
ls public/

# Should contain:
# - index.html
# - css/
# - js/
# - images/

Development Workflow

Starting the Development Server

To start the development server with live reload and TailwindCSS compilation:

npm run start

This will:

  • Watch for changes in your TailwindCSS styles
  • Run the Hugo development server
  • Automatically rebuild when changes are detected
  • Serve your site at http://localhost:1313

Building for Production

To build your site for production:

npm run build

This will:

  • Build and minify your TailwindCSS styles
  • Generate minified Hugo site in the public directory

Next Steps

After successful installation:

  1. Customize Configuration: Review CONFIGURATION.md for all available options
  2. Create Content: Learn about content creation in CONTENT-CREATION.md
  3. Customize Styling: See STYLING.md for theme customization
  4. Add Pages: Use available layouts documented in LAYOUTS.md
  5. Use Shortcodes: Explore components in SHORTCODES.md
  6. Deploy: Follow deployment guides in DEPLOYMENT.md

Updating the Theme

For Git Submodule Installations

# Update to latest version
git submodule update --remote themes/chill-theme

# If there are npm dependency updates, copy the updated files
cp themes/chill-theme/package.json .
cp themes/chill-theme/postcss.config.js .
cp themes/chill-theme/tailwind.config.copy.js ./tailwind.config.js
npm install

# Commit the update
git add themes/chill-theme
git commit -m "Update chill-theme"

For Manual Installations

# Backup your current theme (if you made custom changes)
cp -r themes/chill-theme themes/chill-theme-backup

# Download latest version
curl -L https://github.com/chaoming/chill-theme/archive/refs/heads/main.zip -o theme.zip
unzip theme.zip
rm -rf themes/chill-theme
mv chill-theme-main themes/chill-theme
rm theme.zip

# Copy updated config files and install dependencies
cp themes/chill-theme/package.json .
cp themes/chill-theme/postcss.config.js .
cp themes/chill-theme/tailwind.config.copy.js ./tailwind.config.js
npm install

Update Best Practices

  1. Always backup before updating
  2. Review changelog for breaking changes
  3. Test locally before deploying updates
  4. Check configuration for new options
  5. Update dependencies after theme updates

Version Pinning

To pin to a specific version using Git submodule:

cd themes/chill-theme
git checkout v1.0.0  # Replace with desired version tag
cd ../..
git add themes/chill-theme
git commit -m "Pin theme to v1.0.0"

Troubleshooting

Theme Not Found

Problem: Hugo can't find the theme

Solution:

# Check theme directory exists
ls themes/

# Verify theme name in hugo.toml matches directory name
grep "^theme" hugo.toml

# Should output: theme = "chill-theme"

Extended Version Error

Problem: Error about Hugo Extended being required

Solution:

# Check Hugo version includes "extended"
hugo version

# If not extended, download extended version from:
# https://github.com/gohugoio/hugo/releases

CSS Not Loading

Problem: Site loads without styling

Solution:

# Ensure build stats are enabled in hugo.toml
[build]
  writeStats = true

# Ensure theme dependencies are installed in site root
cp themes/chill-theme/package.json .
cp themes/chill-theme/postcss.config.js .
cp themes/chill-theme/tailwind.config.copy.js ./tailwind.config.js
npm install

# Clear Hugo cache
hugo --gc

# Rebuild and start server
npm run start

Submodule Empty

Problem: Theme directory exists but is empty

Solution:

# Initialize and update submodules
git submodule init
git submodule update --recursive

# If still empty, remove and re-add
git submodule deinit -f themes/chill-theme
rm -rf .git/modules/themes/chill-theme
git rm -f themes/chill-theme
git submodule add https://github.com/chaoming/chill-theme.git themes/chill-theme

npm Dependencies Error

Problem: npm install fails

Solution:

# Clear npm cache
npm cache clean --force

# Delete node_modules and reinstall in site root
rm -rf node_modules package-lock.json
npm install

Port Already in Use

Problem: Hugo server won't start due to port conflict

Solution:

# Use different port (modify package.json start script to add --port flag)
# Or find and kill process using port 1313
lsof -ti:1313 | xargs kill -9  # macOS/Linux
# For Windows, use: netstat -ano | findstr :1313

# Then restart
npm run start

For more troubleshooting help, see TROUBLESHOOTING.md or visit the GitHub Issues page.

Getting Help

If you encounter issues not covered in this guide:

  1. Check TROUBLESHOOTING.md
  2. Review example site configuration
  3. Search GitHub Issues
  4. Create a new issue with:
    • Hugo version (hugo version)
    • Operating system
    • Error messages
    • Steps to reproduce

Additional Resources