Hugo
Setup
-
Language :
-
Go.
-
-
Templates :
-
Go.
-
-
By :
-
Hugo.
-
-
License :
-
Apache-2.0.
-
-
Hugo .
-
Hugo .
-
Go.
-
HTML
-
MD to HTML based on the structure of the file system.
Installation
-
Releases .
-
(2025-10-11)
-
I got the Windows AMD 0.151.0, classic.-
I got this error when running
hugo serverwith the anake theme installed. -
Error: error building site: TOCSS: failed to transform "/ananke/css/main.css" (text/css). Check your Hugo installation; you need the extended version to build SCSS/SASS with transpiler set to 'libsass'.: this feature is not available in your current Hugo version, see https://goo.gl/YMrWcn for more information
-
I guess eu deveria usar a extended, idk.
-
-
I got the Windows AMD 0.151.0, extended.
-
-
If you want to check the version:
hugo version
-
Help:
hugo help
# or for a subcommand:
hugo server --help
New site
-
hugo new site .
Config
Configuration
-
For projects with minimal configuration or projects that do not need to behave differently in different environments, a single configuration file named
hugo.tomlin the root of the project is sufficient.
βββ hugo.toml <-- site configuration
-
Depending on requirements, you may wish to organize your site configuration into subdirectories:
βββ config/ <-- site configuration
β βββ _default/
β βββ hugo.toml
Default Configurations
-
hugo config --printZero >> config/_default/hugo.toml
TOML
-
Open tables :
[server] -
Close tables :
-
TOML tables do not require or allow explicit closing syntax.
-
A table implicitly closes when:
-
Another table header (
[something]or[something.sub]) appears, or -
The file ends.
-
-
Privacy
-
THE DEFAULT IS NO PRIVACY HAHAHHA.
-
All the tracking is enabled by default, and you can only disable or even know these things are enabled if you search through the whole documentation for it.
-
If this is not a crime, it should be a crime.
-
I asked ChatGPT about this and I got mad, so anyway....
-
-
Disqus .
-
Disqus .
-
"Pricing".
-
-
-
Vimeo .
-
Twitter .
-
Youtube .
-
privacyEnhanced-
Whether to block YouTube from storing information about visitors on your website unless the user plays the embedded video.
-
Default is
false.
-
-
-
Configurations used by me:
-
I only enabled youtube, with "privacy enhanced".
-
[privacy]
[privacy.disqus]
disable = true
[privacy.googleanalytics]
disable = true
respectdonottrack = true
[privacy.instagram]
disable = true
simple = true
[privacy.twitter]
disable = false
enablednt = false
simple = false
[privacy.vimeo]
disable = true
enablednt = true
simple = false
[privacy.x]
disable = true
enablednt = true
simple = true
[privacy.youtube]
disable = false
privacyenhanced = true
Renderer
-
-
The default used is GoldMark .
-
The config options need to be placed inside the
hugo.toml.
-
Translation
i18n
-
The
i18ndirectory contains translation tables for multilingual sites. -
details .
Content
Archetypes
-
The
archetypesdirectory contains templates for new content. -
Only used on creation. If an archetype is modified after a file is created, the file doesn't care.
-
Lookup Order :
-
The name of the archetype file defines where the template will be applied.
-
An archetype for a specific content type takes precedence over the default archetype.
-
archetypes/dir1.mdwill be the template forcontent/dir1files.
-
-
For:
hugo new content posts/my-first-post.md -
The archetype lookup order is:
-
archetypes/posts.md -
archetypes/default.md -
themes/my-theme/archetypes/posts.md -
themes/my-theme/archetypes/default.md
-
-
If none of these exists, Hugo uses a built-in default archetype.
-
-
Explicit Archetype :
-
Use the
--kindcommand line flag to specify an archetype when creating content. -
Ex :
-
To create an article using the
articlesarchetype:
hugo new content articles/something.md-
To create an article using the
tutorialsarchetype:
hugo new content --kind tutorials articles/something.md -
-
Content
-
The
contentdirectory contains the markup files (typically Markdown) and page resources that comprise the content of your site.
hugo new content content/posts/my-first-post.md
-
Draft :
-
Rascunho.
-
-
Future :
-
Expired :
-
By default, Hugo will not publish content when:
-
The
draftvalue istrue -
The
dateis in the future -
The
publishDateis in the future -
The
expiryDateis in the past
-
hugo --buildDrafts # or -D
hugo --buildExpired # or -E
hugo --buildFuture # or -F
-
Hugo publishes descendants of draft, future, and expired node pages. To prevent publication of these descendants, use the
cascadefront matter field to cascade build options to the descendant pages.
URL
-
url
-
The url is the entire URL path, defined by the file path and optionally overridden by a url value in front matter.
-
-
ugly url :
-
Is a URL that includes a file extension.
-
CAREFUL :
-
Enabling Ugly URLs will make the URLs go from
/docs/vulkan/vulkan-fast-test/to/docs/vulkan/vulkan-fast-test.html. -
Doing so will affect all image
-
-
-
section
-
A default content type is determined by the section in which a content item is stored.
-
section is determined by the location within the projectβs content directory.
-
section cannot be specified or overridden in front matter.
-
-
slug
-
Is the last segment of the URL path, defined by the file name and optionally overridden by a slug value in front matter.
-
-
path
-
A contentβs path is determined by the sectionβs path to the file.
-
The file path:
-
Is based on the path to the contentβs location AND
-
Does not include the slug
-
-
Content Organization
-
Without any additional configuration, the following will automatically work:
.
βββ content
βββ about
| βββ index.md // <- https://example.org/about/
βββ posts
| βββ firstpost.md // <- https://example.org/posts/firstpost/
| βββ happy
| | βββ ness.md // <- https://example.org/posts/happy/ness/
| βββ secondpost.md // <- https://example.org/posts/secondpost/
βββ quote
βββ first.md // <- https://example.org/quote/first/
βββ second.md // <- https://example.org/quote/second/
Section
-
A section is a top-level content directory or any content directory containing anΒ
_index.mdΒ file.
content/
βββ articles/ <-- section (top-level directory)
β βββ 2022/
β β βββ article-1/
β β β βββ cover.jpg
β β β βββ index.md
β β βββ article-2.md
β βββ 2023/
β βββ article-3.md
β βββ article-4.md
βββ products/ <-- section (top-level directory)
β βββ product-1/ <-- section (has _index.md file)
β β βββ benefits/ <-- section (has _index.md file)
β β β βββ _index.md
β β β βββ benefit-1.md
β β β βββ benefit-2.md
β β βββ features/ <-- section (has _index.md file)
β β β βββ _index.md
β β β βββ feature-1.md
β β β βββ feature-2.md
β β βββ _index.md
β βββ product-2/ <-- section (has _index.md file)
β βββ benefits/ <-- section (has _index.md file)
β β βββ _index.md
β β βββ benefit-1.md
β β βββ benefit-2.md
β βββ features/ <-- section (has _index.md file)
β β βββ _index.md
β β βββ feature-1.md
β β βββ feature-2.md
β βββ _index.md
βββ _index.md
βββ about.md
Static
-
When Hugo compiles the site, it takes everything from the
staticfolder andcontentfolder and puts in the content directory.-
So for example, if you have an image
static/pic.png, the following link will work, as the/pic.pngwill be in the same folder as the note.
-
Images
-
-
"Workarounds for things not officially supported by Markdown."
-
-
-
Everything involves templates, which I hate for low compatibility.
-
-
-
Everything involves templates, which I hate for low compatibility.
-
Taxonomies
-
It's just a way to group content.
-
Hugo automatically generate pages based on taxonomy.
-
Tags :
-
In the frontmatter:
tags = ["tag1", "tag2", "tag3"] -
-
Categories :
-
In the frontmatter:
categories = ["cat1"] -
-
Custom frontmatter keys can be used, but in that case, Hugo will not automatically create the pages for you.
-
For the page be automatically generated in this case, you have to define the taxonomies in the config file:
[taxonomies]
tag = "tags"
category = "categories"
mood = "moods"
assets
-
The
assetsdirectory contains global resources typically passed through an asset pipeline. -
This includes resources such as images, CSS, Sass, JavaScript, and TypeScript.
-
SeeΒ details .
data
-
The
datadirectory contains data files (JSON, TOML, YAML, or XML) that augment content, configuration, localization, and navigation. -
Hugo merges the data files to create a single data structure, accessible with the
Datamethod on aSiteobject.
"Programming"
{{- $js := slice
(resources.Get "js/color-preference.js")
(resources.Get "js/off-canvas.js")
(resources.Get "js/table-of-contents.js")
| resources.Concat "assets/js/docs.js"
| minify
| fingerprint
}}
-
resources.Get-
This loads a single asset from the
assets/directory in your Hugo project. -
So
resources.Get "js/color-preference.js"fetches that file as a Hugo Resource .
-
-
slice-
The
slicefunction creates a list of items. -
Here, it creates a list of the three JS resources.
-
So after this step, you have a slice of three JS resources .
-
-
| resources.Concat "assets/js/docs.js"-
The pipe (
|) passes the slice toresources.Concat. -
resources.Concat "assets/js/docs.js"combines all the files in the slice into a single file. -
"assets/js/docs.js"is the target name for the concatenated file. -
So now you have one JS file combining the three original files.
-
-
| minify-
This compresses the concatenated JS file to reduce its size.
-
Removes whitespace, comments, and sometimes shortens variable names.
-
Good for production, because it makes the site load faster.
-
-
| fingerprint-
This adds a hash to the filename, e.g.,
docs.3a7f9e.js. -
Helps with cache busting : browsers will download a new version if the file changes.
-
-
{{- $js := ... }}-
Finally, the entire processed resource is assigned to the variable
$js. -
You can then use it in your template, for example:
-
(( range $some_page := .Site.Sections ))
<p>
(( printf "%#v" $some_page.File.BaseFileName ))
</p>
(( end ))
Go Templates
-
|-
Pipe operator. Passes the value on the left as input to the function on the right.
-
-
((-/-))-
Trim whitespace before or after the tag.
-
Variables
(( $var1 := "dog" ))
(( $var2 := "cat" ))
Conditionals
-
eq-
Equal
-
-
lt-
Less than
-
-
gt-
Greater than
-
-
ge-
Greater or equal to
-
(( if eq $var1 $var2 ))
It is true
(( else ))
It is false
(( end ))
(( if not (eq $var1 $var2) ))
It is true
(( else ))
It is false
(( end ))
(( if and (lt $var1 $var2) (lt $var1 $var3) ))
It is true
(( else ))
It is false
(( end ))
Functions / Methods
Functions
Range
-
Range .
(( range .Pages ))
(( .Title )) <br>
(( end ))
-
When iterating over something, the variables accessed inside the loop are from the current iteration.
Methods
-
-
Grouped by objects.
-
Site
-
(( .Site.Home.Permalink )) β https://example.org/docs/ (( .Site.Home.RelPermalink )) β /docs/ -
(( range .Site.Pages )) <h2><a HREF="(( .RelPermalink ))">(( .LinkTitle ))</a></h2> (( end )) -
// This structure content/ βββ books/ β βββ book-1.md β βββ book-2.md βββ films/ β βββ film-1.md β βββ film-2.md βββ _index.md // Templated like: (( range .Site.Sections )) <h2><a HREF="(( .RelPermalink ))">(( .LinkTitle ))</a></h2> (( end )) // Renders to: <h2><a HREF="/books/">Books</a></h2> <h2><a HREF="/films/">Films</a></h2> -
// Toml mainSections = ['books', 'films'] // GO (( .Site.MainSections )) β [books films]-
If
mainSectionsis not defined in the site configuration, this method returns a slice with one elementβthe top-level section with the most pages.
-
Page
Pages
Layouts / Templating
Layouts
-
HTML Templates.
-
Any folder in
layoutsthat does not start with_represents the root of a Page path . In Hugo v0.146.0 , this can be nested as deeply as needed, and_shortcodesand_markupfolders can be placed at any level in the tree. -
The
layouts/shortcodesfolder is renamed tolayouts/_shortcodes. -
The
layouts/partialsfolder is renamed tolayouts/_partials. -
The
_defaultfolder is removed.-
Move all files in
layouts/_defaultup to thelayouts/root.
-
-
The above also means that thereβs no top-level
layouts/taxonomyorlayouts/sectionfolders anymore, unless it represents a Page path .-
Move them up to
layouts/with one of the Page kindssection,taxonomyortermas the base name, or place the layouts into the taxonomy Page path .
-
-
A template named
taxonomy.htmlused to be a candidate for both Page kindtermandtaxonomy, now itβs only considered fortaxonomy.-
Create both
taxonomy.htmlandterm.htmlor create a more general layout, e.g.list.html.
-
-
For base templates (e.g.,
baseof.html), in previous Hugo versions, you could prepend one identifier (layout, type, or kind) with a hyphen in front of the baseof keyword.-
Move that identifier after the first βdot,β e.g., rename
list-baseof.htmltobaseof.list.html.
-
-
We have added a new
allβcatch-allβ layout. This means that if you have, e.g.,layouts/all.htmland that is the only template, that layout will be used for all HTML page rendering. -
We have removed the concept of
_internalHugo templates. 1-
Replace constructs similar to
{{ template "_internal/opengraph.html" . }}with{{ partial "opengraph.html" . }}.
-
-
The identifiers that can be used in a template filename are one of the Page kinds (
home,page,section,taxonomy, orterm), one of the standard layouts (list,single, orall), a custom layout (as defined in thelayoutfront matter field), a language (e.g.,en), an output format (e.g.,html,rss), and a suffix representing the media type. E.g.,all.en.htmlandhome.rss.xml. -
The above means that thereβs no such thing as an
index.htmltemplate for the home page anymore.-
Rename
index.htmltohome.html.
-
Types
-
Base :
-
A base template serves as a foundational layout that other templates can build upon. It typically defines the common structural components of your HTML, such as the
html,head, andbodyelements. It also often includes recurring features like headers, footers, navigation, and script inclusions that appear across multiple pages of your site. -
Hugo can apply a base template to the following template types: home , page , section , taxonomy , term , single , list , and all . When Hugo parses any of these template types, it will apply a base template only if the template being parsed meets these specific conditions:
-
It can only contain
defineactions, whitespace, and template comments . No other content is allowed.
-
If a template doesnβt meet all these criteria, Hugo executes it exactly as provided, without applying a base template.
-
When Hugo applies a base template, it replaces its
blockactions with content from the correspondingdefineactions found in the template to which the base template is applied. -
For example, the base template below calls the
partialfunction to includehead,header, andfooterelements. Theblockaction acts as a placeholder, and its content will be replaced by a matchingdefineaction from the template to which it is applied.
-
-
Home :
-
A home template renders your siteβs home page.
-
For example, Hugo applies a base template to the home template, then renders the page content and a list of the siteβs regular pages.
-
-
Page :
-
A page template renders a regular page.
-
For example, Hugo applies a base template to the page template, then renders the page title and page content.
-
-
Section :
-
A section template renders a list of pages within a section .
-
For example, Hugo applies a base template to the section template, then renders the page title, page content, and a list of pages in the current section.
-
-
Taxonomy :
-
A taxonomy template renders a list of terms in a taxonomy .
-
For example, Hugo applies a base template to the taxonomy template, then renders the page title, page content, and a list of terms in the current taxonomy.
-
Within a taxonomy template, the
Dataobject provides these taxonomy-specific methods: -
The
Termsmethod returns a taxonomy object , allowing you to call any of its methods includingAlphabeticalandByCount. For example, use theByCountmethod to render a list of terms sorted by the number of pages associated with each term:
-
-
Term :
-
A term template renders a list of pages associated with a term .
-
For example, Hugo applies a base template to the term template, then renders the page title, page content, and a list of pages associated with the current term.
-
Within a term template, the
Dataobject provides these term-specific methods:
-
-
Single :
-
A single template is a fallback for a page template. If a page template does not exist, Hugo will look for a single template instead.
-
For example, Hugo applies a base template to the single template, then renders the page title and page content.
-
-
List :
-
A list template is a fallback for home , section , taxonomy , and term templates. If one of these template types does not exist, Hugo will look for a list template instead.
-
For example, Hugo applies a base template to the list template, then renders the page title, page content, and a list of pages.
-
_index.md.-
It allows you to add front matter and content to
home,section,taxonomy, andtermpages. -
Access the content and metadata within an
_index.mdfile by invoking theGetPagemethod on aSiteorPageobject.
-
-
-
All :
-
An all template is a fallback for home , page , section , taxonomy , term , single , and list templates. If one of these template types does not exist, Hugo will look for an all template instead.
-
For example, Hugo applies a base template to the all template, then conditionally renders a page based on its page kind.
-
-
Partial :
-
A partial template is typically used to render a component of your site, though you may also create partial templates that return values.
-
Partials vs Shortcodes :
-
You can Partials in Templates.
-
You can Shortcodes in files.
-
(( partial "header" . ))-
The
.represents the scope of what you want to access. -
"header"is the name of the partial template, located aslayouts/partial/header.html.
-
Lookup Order
|Identifier|Description|
|---|---|
|Layout custom|The custom
layout
set in front matter.|
|
Page kinds
|One of
home
,
section
,
taxonomy
,
term
,
page
.|
|Layouts standard 1|
list
or
single
.|
|Output format|The output format (e.g.,
html
,
rss
).|
|Layouts standard 2|
all
.|
|Language|The language (e.g.,
en
).|
|Media type|The media type (e.g.,
text/html
).|
|
Page path
|The page path (e.g.,
/blog/mypost
).|
|Type|
type
set in front matter.
2
|
Shortcodes
-
Predefined chunks of HTML code that you can insert into the markdown files.
-
((< shortcode-name param1 >)) -
Hugo comes will some shortcodes predefined:
-
((< youtube j11Nm4i4XbI >))-
This is the id for the youtube video of oppenheimer ost.
-
-
Emojis
Numbered List / Ordered List
-
.
Themes
-
Hugo Themes are made up of Hugo Layouts.
-
The
themesdirectory contains one or more themes, each in its own subdirectory.
Installing a Theme
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> hugo.toml
# This didn't work. I just placed the string manually
Docs "Modern"
-
https://themes.gohugo.io/themes/e25dx/
-
Meio funcional, meio moderno
-
Ao testar:
-
Hmmmm idk.
-
NΓ£o parece me dar basicamente nenhuma configuraΓ§Γ£o, sΓ³ o que de fato tΓ‘ na demo.
-
-
-
https://themes.gohugo.io/themes/docura/
-
DocumentaΓ§Γ£o legal, mas meio Swift.
-
-
https://themes.gohugo.io/themes/hextra/
-
DocumentaΓ§Γ£o legal, mas meio Swift.
-
-
https://themes.gohugo.io/themes/doks/
-
DocumentaΓ§Γ£o legal, mas meio Swift.
-
-
https://themes.gohugo.io/themes/theme-documentation/
-
DocumentaΓ§Γ£o legal, mas meio Swift.
-
-
https://themes.gohugo.io/themes/lotusdocs/
-
DocumentaΓ§Γ£o legal, mas meio Swift, meio poluido.
-
Docs Funcionais
-
https://themes.gohugo.io/themes/hugo-theme-relearn/
-
https://themes.gohugo.io/themes/hugo-theme-techdoc/
-
https://themes.gohugo.io/themes/dark-theme-editor/
Blogs
-
https://themes.gohugo.io/themes/gohugo-theme-ananke/
-
Mais simples de navegar do que o CleanWhite.
-
-
https://themes.gohugo.io/themes/archie/
-
https://athul.github.io/archie/
-
Achei meio confuso de navegar.
-
-
https://themes.gohugo.io/themes/hugo-theme-console/
-
https://mrmierzejewski.com/hugo-theme-console/
-
Achei meio confuso de navegar.
-
-
https://themes.gohugo.io/themes/hugo-theme-terminalcv/
-
https://coolapso.sh/
-
Divertidinho, mas acho que assim que sai do terminal, o treco fica meio bugado e perde a temΓ‘tica.
-
-
https://themes.gohugo.io/themes/hugo-theme-next/
-
Meio poluido.
-
-
https://themes.gohugo.io/themes/hugo-theme-cleanwhite/
-
https://www.zhaohuabing.com/categories/tech/
-
Acho meio confuso de navegar.
-
-
https://themes.gohugo.io/themes/poison/
-
Muito bΓ‘sico, simplesmente.
-
-
https://themes.gohugo.io/themes/hugo-paper/
-
Muito bΓ‘sico, simplesmente.
-
Stylized
-
https://themes.gohugo.io/themes/neopost/
-
https://themes.gohugo.io/themes/hugo-theme-reimu/
Portfolio / Curriculo
-
https://themes.gohugo.io/themes/adritian-free-hugo-theme/
Gallery
-
https://nicokaiser.github.io/hugo-theme-gallery/
-
Bacana.
-
-
https://themes.gohugo.io/themes/hugo-theme-dream/
-
Meio google, empresa bilhonΓ‘ria, chato.
-
-
https://staticbattery.com/
-
https://themes.gohugo.io/themes/simple-snipcart-shop/
Publish
static
-
The
staticdirectory contains files that will be copied to thepublicdirectory when you build your site. -
For example:
favicon.ico,robots.txt, and files that verify site ownership. -
Before the introduction of page bundles and asset pipelines , the
staticdirectory was also used for images, CSS, and JavaScript.
public
-
The
publicdirectory contains the published website, generated when you run thehugoorhugo servercommands. -
Hugo recreates this directory and its content as needed.
-
SeeΒ details .
resources
-
The
resourcesdirectory contains cached output from Hugoβs asset pipelines, generated when you run thehugoorhugo servercommands. -
By default this cache directory includes CSS and images. Hugo recreates this directory and its content as needed.
Host Locally
-
Used to view your site while developing layouts or creating content
hugo server
# Only worked for hugo extended.
-
Life Reload :
-
While the server is running, it watches your project directory for changes to assets, configuration, content, data, layouts, translations, and static files. When it detects a change, the server rebuilds your site and refreshes your browser using LiveReload .
-
While the server is running, Hugo injects JavaScript into the generated HTML pages. The LiveReload script creates a connection from the browser to the server via web sockets. You do not need to install any software or browser plugins, nor is any configuration required.
-
Automatic Redirection :
-
If you want your browser to automatically redirect to the page you last modified, run:
hugo server --navigateToChanged -
-
-
New notes are created as drafts. If you want to see those, use:
hugo server --buildDrafts
Host Remote
Publish
hugo
-
Directories :
-
Default publish directory:
-
/public.
-
-
To publish your site to a different directory, use the
--destinationflag or setpublishDirin your site configuration. -
This is also used, I think:
-
/resources.
-
-
-
Inside the
/public:public/ βββ categories/ β βββ index.html β βββ index.xml <-- RSS feed for this section βββ posts/ β βββ my-first-post/ β β βββ index.html β βββ index.html β βββ index.xml <-- RSS feed for this section βββ tags/ β βββ index.html β βββ index.xml <-- RSS feed for this section βββ index.html βββ index.xml <-- RSS feed for the site βββ sitemap.xml-
In a simple hosting environment, where you typically
ftp,rsync, orscpyour files to the root of a virtual host, the contents of thepublicdirectory are all that you need. -
Most of our users deploy their sites using a CI/CD workflow, where a push 1 to their GitHub or GitLab repository triggers a build and deployment. Popular providers include AWS Amplify , CloudCannon , Cloudflare Pages , GitHub Pages , GitLab Pages , and Netlify .
-
-
Watch out! :
-
Hugo does not clear the
publicdirectory before building your site. Depending on the current evaluation of the four conditions above, after the build yourpublicdirectory may contain extraneous files from a previous build. -
A common practice is to manually clear the contents of the
publicdirectory before each build to remove draft, expired, and future content.
-
Union File System
-
Hugo creates a union file system, allowing you to mount two or more directories to the same location.
-
For example, letβs say your home directory contains a Hugo project in one directory, and shared content in another:
home/
βββ user/
βββ my-site/
β βββ content/
β β βββ books/
β β β βββ _index.md
β β β βββ book-1.md
β β β βββ book-2.md
β β βββ _index.md
β βββ themes/
β β βββ my-theme/
β βββ hugo.toml
βββ shared-content/
βββ films/
βββ _index.md
βββ film-1.md
βββ film-2.md
-
You can include the shared content when you build your site using mounts. In your site configuration:
[module]
[module.mounts](module.mounts)
source = 'content'
target = 'content'
[module.mounts](module.mounts)
source = '/home/user/shared-content'
target = 'content'
-
When you overlay one directory on top of another, you must mount both directories.
-
Hugo does not follow symbolic links. If you need the functionality provided by symbolic links, use Hugoβs union file system instead.
-
After mounting, the union file system has this structure:
home/
βββ user/
βββ my-site/
βββ content/
β βββ books/
β β βββ _index.md
β β βββ book-1.md
β β βββ book-2.md
β βββ films/
β β βββ _index.md
β β βββ film-1.md
β β βββ film-2.md
β βββ _index.md
βββ themes/
β βββ my-theme/
βββ hugo.toml
-
When two or more files have the same path, the order of precedence follows the order of the mounts. For example, if the shared content directory contains
books/book-1.md, it will be ignored because the projectβscontentdirectory was mounted first. -
You can mount directories to
archetypes,assets,content,data,i18n,layouts, andstatic. SeeΒ details . -
You can also mount directories from Git repositories using Hugo Modules. SeeΒ details .