HUGO

  • News
  • Docs
  • Themes
  • Showcase
  • Community
  • GitHub
gohugoio Star
  • About Hugo
    • Overview
    • What is Hugo
    • Hugo features
    • Static site generators
    • Hugo's security model
    • Hugo and the GDPR
    • License
  • Installation
    • Overview
    • macOS
    • Linux
    • Windows
    • BSD
  • Getting started
    • Overview
    • Quick start
    • Basic usage
    • Directory structure
    • Configuration
    • Configure markup
    • Glossary of terms
    • External learning resources
  • Quick reference
    • Overview
    • Emojis
    • Functions
    • Methods
    • Page collections
  • Content management
    • Overview
    • Organization
    • Page bundles
    • Content formats
    • Front matter
    • Build options
    • Page resources
    • Image processing
    • Shortcodes
    • Related content
    • Sections
    • Content types
    • Archetypes
    • Taxonomies
    • Summaries
    • Links and cross references
    • URL management
    • Menus
    • Static files
    • Table of contents
    • Comments
    • Multilingual
    • Markdown attributes
    • Syntax highlighting
    • Diagrams
    • Mathematics
  • Templates
    • Overview
    • Templating
    • Template lookup order
    • Base templates and blocks
    • Single page templates
    • List templates
    • Homepage template
    • Section templates
    • Taxonomy templates
    • Pagination
    • Content view templates
    • Partial templates
    • Shortcode templates
    • Menu templates
    • Data templates
    • RSS templates
    • Sitemap templates
    • Internal templates
    • Custom output formats
    • 404 page
    • Robots.txt
  • Functions
    • Overview
    • cast
    • collections
    • compare
    • crypto
    • data
    • debug
    • diagrams
    • encoding
    • fmt
    • global
    • go template
    • hugo
    • images
    • inflect
    • js
    • lang
    • math
    • openapi3
    • os
    • partials
    • path
    • reflect
    • resources
    • safe
    • strings
    • templates
    • time
    • transform
    • urls
  • Methods
    • Overview
    • Duration
    • Menu
    • Menu entry
    • Page
    • Pages
    • Resource
    • Shortcode
    • Site
    • Taxonomy
    • Time
  • Render hooks
    • Overview
    • Introduction
    • Code blocks
    • Headings
    • Images
    • Links
  • Hugo Modules
    • Overview
    • Configure Hugo modules
    • Use Hugo Modules
    • Theme components
  • Hugo Pipes
    • Overview
    • Introduction
    • Transpile Sass to CSS
    • PostCSS
    • PostProcess
    • JavaScript building
    • Babel
    • Asset minification
    • Concatenating assets
    • Fingerprinting and SRI hashing
    • Resource from string
    • Resource from template
  • CLI
  • Troubleshooting
    • Overview
    • Audit
    • Logging
    • Inspection
    • Deprecation
    • Performance
    • FAQs
  • Developer tools
    • Overview
    • Editor plugins
    • Front-ends
    • Search
    • Migrations
    • Other projects
  • Hosting and deployment
    • Overview
    • Hugo Deploy
    • Deploy with Rclone
    • Deploy with Rsync
    • Host on 21YunBox
    • Host on AWS Amplify
    • Host on Azure Static Web Apps
    • Host on Cloudflare Pages
    • Host on Firebase
    • Host on GitHub Pages
    • Host on GitLab Pages
    • Host on KeyCDN
    • Host on Netlify
    • Host on Render
  • Contribute
    • Overview
    • Development
    • Documentation
    • Themes
  • Maintenance
CONTRIBUTE

Development

Contribute to the development of Hugo.

Introduction

You can contribute to the Hugo project by:

  • Answering questions on the forum
  • Improving the documentation
  • Monitoring the issue queue
  • Creating or improving themes
  • Squashing bugs

Please submit documentation issues and pull requests to the documentation repository.

If you have an idea for an enhancement or new feature, create a new topic on the forum in the “Feature” category. This will help you to:

  • Determine if the capability already exists
  • Measure interest
  • Refine the concept

If there is sufficient interest, create a proposal. Do not submit a pull request until the project lead accepts the proposal.

For a complete guide to contributing to Hugo, see the Contribution Guide.

Prerequisites

To build the extended edition of Hugo from source you must:

  1. Install Git
  2. Install Go version 1.20 or later
  3. Install a C compiler, either GCC or Clang
  4. Update your PATH environment variable as described in the Go documentation

See these detailed instructions to install GCC on Windows.

GitHub workflow

This section assumes that you have a working knowledge of Go, Git and GitHub, and are comfortable working on the command line.

Use this workflow to create and submit pull requests.

Step 1
Fork the project repository.
Step 2
Clone your fork.
Step 3
Create a new branch with a descriptive name that includes the corresponding issue number.

For a new feature:

git checkout -b feat/implement-some-feature-99999

For a bug fix:

git checkout -b fix/fix-some-bug-99999
Step 4
Make changes.
Step 5
Compile and install:
CGO_ENABLED=1 go install -tags extended
Step 6
Test your changes:
go test ./...
Step 7
Commit your changes with a descriptive commit message:
  • Provide a summary on the first line, typically 50 characters or less, followed by a blank line.
  • Optionally, provide a detailed description where each line is 80 characters or less, followed by a blank line.
  • Add one or more “Fixes” or “Closes” keywords, each on its own line, referencing the issues addressed by this change.

For example:

git commit -m "tpl/strings: Create wrap function

The strings.Wrap function wraps a string into one or more lines,
splitting the string after the given number of characters, but not
splitting in the middle of a word.

Fixes #99998
Closes #99999"

See the commit message guidelines for details.

Step 8
Push the new branch to your fork of the documentation repository.
Step 9
Visit the project repository and create a pull request (PR).
Step 10
A project maintainer will review your PR and may request changes. You may delete your branch after the maintainer merges your PR.

Building from source

You can build, install, and test Hugo at any point in its development history. The examples below build and install the extended version of Hugo.

To build and install the latest release:

CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest

To build and install a specific release:

CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.122.0

To build and install at the latest commit on the master branch:

CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@master

To build and install at a specific commit:

CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@0851c17

See also

  • Documentation
  • BSD
  • Emojis
  • GitInfo
  • Host on 21YunBox

On this page

  • Introduction
  • Prerequisites
  • GitHub workflow
  • Building from source
Last updated: February 8, 2024: Include examples of building from source (68a8c87b)
Improve this page
By the Hugo Authors
Hugo Logo
  • File an Issue
  • Get Help
  • @GoHugoIO
  • @spf13
  • @bepsays

Netlify badge

 

Hugo Sponsors

 

The Hugo logos are copyright © Steve Francia 2013–2024.

The Hugo Gopher is based on an original work by Renée French.

  • News
  • Docs
  • Themes
  • Showcase
  • Community
  • GitHub
  • About Hugo
  • Installation
  • Getting started
  • Quick reference
  • Content management
  • Templates
  • Functions
  • Methods
  • Render hooks
  • Hugo Modules
  • Hugo Pipes
  • CLI
  • Troubleshooting
  • Developer tools
  • Hosting and deployment
  • Contribute
  • Maintenance