- About Hugo
- Getting Started
- Hugo Modules
-
Content Management
- 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 and i18n
- Syntax Highlighting
-
Templates
- Templates Overview
- Introduction
- Template Lookup Order
- Custom Output Formats
- Base Templates and Blocks
- List Page Templates
- Homepage Template
- Section Templates
- Taxonomy Templates
- Single Page Templates
- Content View Templates
- Data Templates
- Partial Templates
- Shortcode Templates
- Local File Templates
- 404 Page
- Menu Templates
- Pagination
- RSS Templates
- Sitemap Template
- Robots.txt
- Internal Templates
- Alternative Templating
- Template Debugging
-
Functions
- Functions Quick Reference
- .AddDate
- .Format
- .Get
- .GetPage
- .HasMenuCurrent
- .IsMenuCurrent
- .Param
- .Render
- .RenderString
- .Scratch
- .Unix
- absLangURL
- absURL
- after
- anchorize
- append
- apply
- base64
- chomp
- complement
- cond
- countrunes
- countwords
- dateFormat
- default
- delimit
- dict
- echoParam
- emojify
- eq
- errorf and warnf
- fileExists
- findRE
- first
- float
- ge
- getenv
- group
- gt
- hasPrefix
- highlight
- hmac
- htmlEscape
- htmlUnescape
- hugo
- humanize
- i18n
- Image Functions
- in
- index
- int
- intersect
- isset
- jsonify
- lang.Merge
- lang.NumFmt
- last
- le
- len
- lower
- lt
- markdownify
- Math
- md5
- merge
- ne
- now
- os.Stat
- partialCached
- path.Base
- path.Dir
- path.Ext
- path.Join
- path.Split
- plainify
- pluralize
- printf
- println
- querify
- range
- readDir
- readFile
- ref
- reflect.IsMap
- reflect.IsSlice
- relLangURL
- relref
- relURL
- replace
- replaceRE
- safeCSS
- safeHTML
- safeHTMLAttr
- safeJS
- safeURL
- seq
- sha
- shuffle
- singularize
- site
- slice
- slicestr
- sort
- split
- string
- strings.Count
- strings.HasSuffix
- strings.Repeat
- strings.RuneCount
- strings.TrimLeft
- strings.TrimPrefix
- strings.TrimRight
- strings.TrimSuffix
- substr
- symdiff
- templates.Exists
- time
- title
- transform.Unmarshal
- trim
- truncate
- union
- uniq
- upper
- urlize
- urls.Parse
- where
- with
- Variables
- Hugo Pipes
- CLI
- Troubleshooting
- Tools
- Hosting & Deployment
- Contribute
- Maintenance
Templates
Templates
Go templating, template types and lookup order, shortcodes, and data.
Read More »
Introduction to Hugo Templating
Hugo uses Go’s
html/template
and text/template
libraries as the basis for the templating.
Read More »
Hugo's Lookup Order
Hugo searches for the layout to use for a given page in a well defined order, starting from the most specific.
Read More »
Custom Output Formats
Hugo can output content in multiple formats, including calendar events, e-book formats, Google AMP, and JSON search indexes, or any custom text format.
Read More »
Base Templates and Blocks
The base and block constructs allow you to define the outer shell of your master templates (i.e., the chrome of the page).
Read More »
Lists of Content in Hugo
Lists have a specific meaning and usage in Hugo when it comes to rendering your site homepage, section page, taxonomy list, or taxonomy terms list.
Read More »
Homepage Template
The homepage of a website is often formatted differently than the other pages. For this reason, Hugo makes it easy for you to define your new site’s homepage as a unique template.
Read More »
Section Page Templates
Templates used for section pages are lists and therefore have all the variables and methods available to list pages.
Read More »
Taxonomy Templates
Taxonomy templating includes taxonomy list pages, taxonomy terms pages, and using taxonomies in your single page templates.
Read More »
Single Page Templates
The primary view of content in Hugo is the single view. Hugo will render every Markdown file provided with a corresponding single template.
Read More »
Content View Templates
Hugo can render alternative views of your content, which is especially useful in list and summary views.
Read More »
Data Templates
In addition to Hugo’s built-in variables, you can specify your own custom data in templates or shortcodes that pull from both local and dynamic sources.
Read More »
Partial Templates
Partials are smaller, context-aware components in your list and page templates that can be used economically to keep your templating DRY.
Read More »
Create Your Own Shortcodes
You can extend Hugo’s built-in shortcodes by creating your own using the same templating syntax as that for single and list pages.
Read More »
Local File Templates
Hugo’s
readDir
and readFile
functions make it easy to traverse your project’s directory structure and write file contents to your templates.
Read More »
Custom 404 Page
If you know how to create a single page template, you have unlimited options for creating a custom 404.
Read More »
Menu Templates
Menus are a powerful but simple feature for content management but can be easily manipulated in your templates to meet your design needs.
Read More »
Pagination
Hugo supports pagination for your homepage, section pages, and taxonomies.
Read More »
RSS Templates
Hugo ships with its own RSS 2.0 template that requires almost no configuration, or you can create your own RSS templates.
Read More »
Sitemap Template
Hugo ships with a built-in template file observing the v0.9 of the Sitemap Protocol, but you can override this template if needed.
Read More »
Robots.txt File
Hugo can generate a customized robots.txt in the same way as any other template.
Read More »
Internal Templates
Hugo ships with a group of boilerplate templates that cover the most common use cases for static websites.
Read More »
DEPRECATED - Alternative Templating Languages
DEPRECATED - Support for Ace & Amber templating has been removed in version 0.62
Read More »
Template Debugging
You can use Go templates'
printf
function to debug your Hugo templates. These snippets provide a quick and easy visualization of the variables available to you in different contexts.
Read More »