Detalhes sobre "Hugo" framework
-
archetypes/- Stores content templates (called archetypes).
- When you run
hugo new content/post.md, Hugo uses the default archetype (archetypes/default.md) to pre-fill the front matter in the new file. - You can create custom archetypes for different content types.
-
assets/- Used for Hugo Pipes, which allows for asset processing (minification, fingerprinting, SASS/SCSS compilation, etc.).
- If you’re using raw CSS or JavaScript that needs processing, it goes here.
- If you’re just storing images, use
static/instead.
-
content/- The main content of your site.
- Typically contains markdown (
.md) files. - Example structure:
content/ ├── \_index.md # Main index page (optional) ├── about.md # A single page (https://yoursite.com/about/) ├── blog/ │ ├── post1.md │ ├── post2.md - Files here will be transformed into HTML pages.
-
data/- Stores structured data (
.yaml,.json,.toml) that can be used in templates. - Useful if you need structured information (e.g., a list of people, links, etc.).
- Stores structured data (
-
hugo.toml(formerlyconfig.toml)- Hugo’s main configuration file.
- Can be
.toml,.yaml, or.json(hugo.yamlorhugo.json). - Defines settings like theme, base URL, and menu structure.
-
i18n/- Stores translation files for multi-language support.
- Uses
.tomlfiles to provide different language versions of site content.
-
layouts/- Stores custom HTML templates (overrides theme templates).
- Structure:
layouts/ ├── \_default/ │ ├── baseof.html # Base template (wraps all pages) │ ├── single.html # Template for single pages │ ├── list.html # Template for section pages ├── partials/ # Reusable snippets (e.g., header, footer) ├── index.html # Homepage override - If you want full control over site appearance, edit files here.
-
static/- Stores static files (images, CSS, JavaScript, fonts).
- These are served as-is (no processing).
- Example:
static/ ├── img/ │ ├── logo.png ├── css/ │ ├── style.css
-
themes/- Stores Hugo themes.
- If you use a theme, its files will be inside
themes/your-theme/. - Themes contain their own
layouts/,static/, andassets/.
- You write content in
content/. - Hugo processes assets from
assets/(if needed). - Hugo applies templates from
layouts/to format content. - Static files from
static/are copied as-is to the final site. - Hugo generates a fully static HTML site in
public/when you runhugo.