Detalhes sobre "Hugo" framework

  1. 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.
  2. 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.
  3. 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.
  4. 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.).
  5. hugo.toml (formerly config.toml)

    • Hugo’s main configuration file.
    • Can be .toml, .yaml, or .json (hugo.yaml or hugo.json).
    • Defines settings like theme, base URL, and menu structure.
  6. i18n/

    • Stores translation files for multi-language support.
    • Uses .toml files to provide different language versions of site content.
  7. 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.
  8. static/

    • Stores static files (images, CSS, JavaScript, fonts).
    • These are served as-is (no processing).
    • Example:
      static/
      ├── img/
      │   ├── logo.png
      ├── css/
      │   ├── style.css
      
  9. themes/

    • Stores Hugo themes.
    • If you use a theme, its files will be inside themes/your-theme/.
    • Themes contain their own layouts/, static/, and assets/.

  • 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 run hugo.