Hi there! Internet Explorer is no longer supported.

Please use a modern web browser such as Firefox, Chromium or Edge. Thank you!

Site and Theme Setup

Get started with Hugo and the Trigo Theme.

Warning

Trigo Theme is still in active development. The following documentation is not yet accurate or up-to-date. Have a question or feedback? Feel free to open an issue!

What is the Trigo Theme?

Trigo is a simple, modern, fast, feature-packed and flexible Hugo theme to build static websites for documentation, blogs, portfolios and more.

Hugo is a one of the most popular static site generator. Hugo is a single binary, making it easy to install and run on various platforms. Extremely fast and reliable, it renders a site with thousands of pages in milliseconds.

Trigo is a custom made theme focused on efficiency, flexibility and with a minimal footprint. No extra dependencies are required. A single YAML configuration file and Markdown content is all what is needed. Focus on writing quality content and tweak the theme style if desired.

Features

Note

The content below is a placeholder and will be changed soon.

Start as New Project

There are two main ways to add the Trigo Theme to your Hugo project:

  1. Hugo Modules (Recommended): The simplest and recommended method. Hugo modules let you pull in the theme directly from its online source. Theme is downloaded automatically and managed by Hugo.

  2. Git Submodule: Alternatively, add Trigo as a Git Submodule. The theme is downloaded by Git and stored in your project’s themes folder.

Setup Trigo as Hugo module

Prerequisites

Before starting, you need to have the following software installed:

Initialize a new Hugo site

hugo new site my-site --format=yaml

Configure Trigo theme via module

# initialize hugo module
cd my-site
hugo mod init github.com/username/my-site

# add Trigo theme
hugo mod get github.com/FreeCAD/website

Configure hugo.yaml to use Trigo theme by adding the following:

module:
  imports:
    - path: github.com/FreeCAD/website

Create your first content pages

Create new content page for the home page and the documentation page:

hugo new content/_index.md
hugo new content/docs/_index.md

Preview the site locally

hugo server --buildDrafts --disableFastRender

Your new site preview is available at http://localhost:1313/.

How to update the Theme?

To update all Hugo modules in your project to their latest versions, run the following command:

hugo mod get -u

To update Trigo to the latest released version, run the following command:

hugo mod get -u github.com/FreeCAD/website

If you want to try the most recent changes before the next release, update the module to the development branch directly (⚠️ may contain unstable/breaking changes):

hugo mod get -u github.com/FreeCAD/website@main

See Hugo Modules for more details.


Setup Trigo as Git submodule

Prerequisites

Before starting, you need to have the following software installed:

Initialize a new Hugo site

hugo new site my-site --format=yaml

Add Trigo theme as a Git submodule

Switch to the site directory and initialize a new Git repository:

cd my-site
git init

Then, add Trigo Theme as a Git submodule:

git submodule add https://github.com/FreeCAD/website.git themes/Trigo

Configure hugo.yaml to use Trigo Theme by adding the following:

theme: Trigo

Create your first content pages

Create new content page for the homepage and the documentation page:

hugo new content/_index.md
hugo new content/docs/_index.md

Preview the site locally

hugo server --buildDrafts --disableFastRender

Your new site preview is available at http://localhost:1313/.

When using CI/CD for Hugo website deployment, it’s essential to ensure that the following command is executed before running the hugo command.

git submodule update --init

Failure to run this command results in the theme folder not being populated with Trigo theme files, leading to a build failure.

How to update the Theme?

To update all submodules in your repository to their latest commits, run the following command:

git submodule update --remote

To update Trigo to the latest commit, run the following command:

git submodule update --remote themes/Trigo

See Git submodules for more details.


Intro

Guide

Follow Quick Start guide to setup hugo and create a new site.

Quote

Note: Use -f to select yml format

hugo new site <name of site> -f yml

Make sure you install latest version of hugo.

After you have created a new site, at Step 3 follow the steps:

Method 1

Inside the folder of your Hugo site, run:

git clone https://github.com/FreeCAD/website PATH_TO_YOUR_LOCAL_GIT_DIRECTORY --depth=1
Quote

Updating theme :

cd PATH_TO_YOUR_LOCAL_GIT_DIRECTORY
git pull

Method 2

Or you can Download as Zip from Github Page and extract in your themes directory

Finally …

Add in config.yml:

theme: Trigo

Method 4

hugo mod init PATH_TO_YOUR_LOCAL_GIT_DIRECTORY
module:
  imports:
  - path: github.com/FreeCAD/website/tree/main/themes/Trigo
hugo mod get -u

Sample config.yml

Use appropriately

baseURL: https://examplesite.com/
title: "ExampleSite"

theme: Trigo

enableRobotsTXT: true
buildDrafts: false
buildFuture: false
buildExpired: false
pygmentsUseClasses: true

googleAnalytics: UA-123-45

minify:
  disableXML: true
  minifyOutput: true

params:
  env: production # to enable google analytics, opengraph and schema.
  title: "ExampleSite"
  description: "ExampleSite description"
  keywords: [Blog, Portfolio]
  authors: [Me, You, Tom Sawyer]
  images: [<link or path of image for opengraph>]
  DateFormat: January 2, 2006
  defaultChroma: auto # dark, light

  showReadingTime: true
  showShareButtons: true
  showPagination: true
  showCopy: false

  label:
    text: Home
    icon: /apple-touch-icon.webp
    iconHeight: 35

  analytics:
    google:
      SiteVerificationTag: XYZabc

Sample Page.md

---
title: "My first post"
date: 2020-09-15T11:30:03+00:00
# weight: 1
# aliases: [/first]
tags: [first]
authors: [Me, You, Tom Sawyer]

draft: false
description: "Desc Text."
disableShare: false
showReadingTime: true
showPagination: true
cover:
  image: <image path/url> # image path/url
  alt: <alt text> # alt text
  caption: <text> # display caption under cover
---

You can use it by creating archetypes/post.md

hugo new --kind post <name>