mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-02 11:42:37 +00:00
2c0d1ccdcd
73f355ceUpdate theme83ff50c2Use example.com in examples71292134Add alias news > release-notes2e15f642Update theme8eef09d2Add Pygments configuration572b9e75Clean up the code shortcode usea1b2fd3bRemove the code fence language codes1473b1d9Remove redundant textb92c2042Update theme8f439c28Edit contributing section in README8bcf8a19Add contributing section to README4c44ee1cFix broken content file2bdc7710Clarify .Data.Pages sorting in lists.md092271c2Use infinitive mood for main titlesb9b8abefUpdate theme to reflect change to home page contentb897b71bChange copy to use sentence casefd675ee5Enable RSS feed for sections060a5e27Correct movie title in taxonomies.md6a5ca96aUpdate displayed site name for Hub22f4b7a4Add example of starting up the local serverd9612cb3Update themea8c3988aUpdate theme4198189dUpdate theme12d6b016Update theme2b1c4197Update themeb6d90a1eFix News release titlescfe751dbAdd some build info to README git-subtree-dir: docs git-subtree-split:73f355ce0d
4.1 KiB
4.1 KiB
title, linktitle, description, date, publishdate, lastmod, categories, menu, weight, sections_weight, draft, aliases, toc
| title | linktitle | description | date | publishdate | lastmod | categories | menu | weight | sections_weight | draft | aliases | toc | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Directory Structure | Directory Structure | Hugo's CLI scaffolds a project directory structure and then takes that single directory and uses it as the input to create a complete website. | 2017-01-02 | 2017-02-01 | 2017-03-09 |
|
|
50 | 50 | false |
|
true |
New Site Scaffolding
Running the hugo new site generator from the command line will create a directory structure with the following elements:
.
├── archetypes
├── config.toml
├── content
├── data
├── layouts
├── static
└── themes
Directory Structure Explained
The following is a high-level overview of each of the directories with links to each of their respective sections with in the Hugo docs.
archetypes- You can create new content files in Hugo using the
hugo newcommand. By default, hugo will create new content files with at leastdate,title(inferred from the file name), anddraft = true. This saves time and promotes consistency for sites using multiple content types. You can create your own archetypes with custom preconfigured front matter fields as well. config.toml- Every Hugo project should have a configuration file in TOML, YAML, or JSON format at the root. Many sites may need little to no configuration, but Hugo ships with a large number of configuration directives for more granular directions on how you want Hugo to build your website.
content- All content for your website will live inside this directory. Each top-level folder in Hugo is considered a content section. For example, if your site has three main sections---
blog,articles, andtutorials---you will have three directories atcontent/blog,content/articles, andcontent/tutorials. Hugo uses sections to assign default content types. data- This directory is used to store configuration files that can be used by Hugo when generating your website. You can write these files in YAML, JSON, or TOML format. In addition to the files you add to this folder, you can also create data templates that pull from dynamic content.
layouts- Stores templates in the form of
.htmlfiles that specify how views of your content will be rendered into a static website. Templates include list pages, your homepage, taxonomy templates, partials, single page templates, and more. static- stores all the static content for your future website: images, CSS, JavaScript, etc. When Hugo builds your site, all assets inside your static directory are copied over as-is. A good example of using the
staticfolder is for verifying site ownership on Google Search Console, where you want Hugo to copy over a complete HTML file without modifying its content.
{{% note %}} Hugo does not currently ship with an asset pipeline (#3207). You can solicit support from the community in the Hugo forums or check out a few of the Hugo starter kits for examples of how Hugo developers are managing static assets. {{% /note %}}