mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-25 15:58:53 +00:00
Add more content to getting started pages
This commit is contained in:
@@ -9,10 +9,129 @@ categories: [project organization]
|
||||
tags: [source, organization, directories,fundamentals]
|
||||
weight: 50
|
||||
draft: false
|
||||
needsreview: true
|
||||
aliases: [/overview/source-directory/]
|
||||
notesforauthors:
|
||||
---
|
||||
|
||||
<!-- copied from old overview/source-directory -->
|
||||
|
||||
Hugo takes a single directory and uses it as the input for creating a complete
|
||||
website.
|
||||
|
||||
|
||||
The top level of a source directory will typically have the following elements:
|
||||
|
||||
```bash
|
||||
▸ archetypes/
|
||||
▸ content/
|
||||
▸ data/
|
||||
▸ i18n/
|
||||
▸ layouts/
|
||||
▸ static/
|
||||
▸ themes/
|
||||
config.toml
|
||||
```
|
||||
|
||||
Learn more about the different directories and what their purpose is:
|
||||
|
||||
* [config](/getting-started/configuration/)
|
||||
* [data](/templates/data-templates/)
|
||||
* [i18n](/content-management/multilingual-mode/)
|
||||
* [archetypes](/content-management/archetypes/)
|
||||
* [content](/content-managemt/content-organization/)
|
||||
* [layouts](/templates/)
|
||||
* [static](/themes/creating-a-theme/)
|
||||
* [themes](/themes/)
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
An example directory may look like:
|
||||
|
||||
```bash
|
||||
.
|
||||
├── config.toml
|
||||
├── archetypes
|
||||
| └── default.md
|
||||
├── content
|
||||
| ├── post
|
||||
| | ├── firstpost.md
|
||||
| | └── secondpost.md
|
||||
| └── quote
|
||||
| | ├── first.md
|
||||
| | └── second.md
|
||||
├── data
|
||||
├── i18n
|
||||
├── layouts
|
||||
| ├── _default
|
||||
| | ├── single.html
|
||||
| | └── list.html
|
||||
| ├── partials
|
||||
| | ├── header.html
|
||||
| | └── footer.html
|
||||
| ├── taxonomies
|
||||
| | ├── category.html
|
||||
| | ├── post.html
|
||||
| | ├── quote.html
|
||||
| | └── tag.html
|
||||
| ├── post
|
||||
| | ├── li.html
|
||||
| | ├── single.html
|
||||
| | └── summary.html
|
||||
| ├── quote
|
||||
| | ├── li.html
|
||||
| | ├── single.html
|
||||
| | └── summary.html
|
||||
| ├── shortcodes
|
||||
| | ├── img.html
|
||||
| | ├── vimeo.html
|
||||
| | └── youtube.html
|
||||
| ├── index.html
|
||||
| └── sitemap.xml
|
||||
├── themes
|
||||
| ├── hyde
|
||||
| └── doc
|
||||
└── static
|
||||
├── css
|
||||
└── js
|
||||
```
|
||||
|
||||
This directory structure tells us a lot about this website:
|
||||
|
||||
1. The website intends to have two different types of content: *posts* and *quotes*.
|
||||
2. It will also apply two different taxonomies to that content: *categories* and *tags*.
|
||||
3. It will be displaying content in 3 different views: a list, a summary, and a full-page view.
|
||||
|
||||
## Content for Home Page and Other List Pages
|
||||
|
||||
Since Hugo 0.18, "everything" is a `Page` that can have content and metadata, like `.Params`, attached to it -- and share the same set of [page variables](/variables-and-params/page-variables/).
|
||||
|
||||
To add content and front matter to the home page, a section, a taxonomy or a taxonomy terms listing, add a markdown file with the base name `_index` on the relevant place on the file system.
|
||||
|
||||
For the default Markdown content, the filename will be `_index.md`.
|
||||
|
||||
Se the example directory tree below.
|
||||
|
||||
**Note that you don't have to create `_index` file for every section, taxonomy and similar, a default page will be created if not present, but with no content and default values for `.Title` etc.**
|
||||
|
||||
```bash
|
||||
└── content
|
||||
├── _index.md
|
||||
├── categories
|
||||
│ ├── _index.md
|
||||
│ └── photo
|
||||
│ └── _index.md
|
||||
├── post
|
||||
│ ├── _index.md
|
||||
│ └── firstpost.md
|
||||
└── tags
|
||||
├── _index.md
|
||||
└── hugo
|
||||
└── _index.md
|
||||
```
|
||||
|
||||
|
||||
<!-- copied from old version of quick start -->
|
||||
|
||||
* **archetypes**: You can create new content files in Hugo using the `hugo new` command. When you run that command, it adds few configuration properties to the post like date and title. [Archetype][archetypes] allows you to define your own configuration properties that will be added to front matter of new content files whenever `hugo new` command is used.
|
||||
|
||||
@@ -12,6 +12,7 @@ draft: false
|
||||
slug:
|
||||
aliases: [/getting-started/using-the-docs/]
|
||||
toc: true
|
||||
needsreview: true
|
||||
notesforauthors:
|
||||
needsreview: true
|
||||
---
|
||||
|
||||
@@ -48,7 +48,8 @@ We wish you all a Merry Christmas and a Happy New Year.<br>
|
||||
## Highlights
|
||||
|
||||
The primary new feature in Hugo 0.18 is that every piece of content is now a `Page` ({{<gh 2297>}}).
|
||||
This means that every page, including the home page, can have a content file with frontmatter.
|
||||
This means that every page, including the home page, can have a content file with front matter.
|
||||
|
||||
Not only is this a much simpler model to understand, it is also faster and paved the way for several important new features:
|
||||
|
||||
* Enable proper titles for Nodes {{<gh 1051>}}
|
||||
|
||||
Reference in New Issue
Block a user