Hugo Doc - Source Organization

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:

Hugo 使用一个目录, 并且使用它来创建一个完整的网站.

根目录的顶层有如下目录和文件:

▸ archetypes/
▸ content/
▸ data/
▸ layouts/
▸ static/
▸ themes/
  config.toml

了解这些目录和文件的作用:

  • config
  • data
  • archetypes
  • content
  • layouts
  • static
  • themes

例子

例子的目录结构如下:

.
├── config.toml
├── archetypes
|   └── default.md
├── content
|   ├── post
|   |   ├── firstpost.md
|   |   └── secondpost.md
|   └── quote
|   |   ├── first.md
|   |   └── second.md
├── data
├── 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

这个目录结构阐述了这个站点的许多信息:

  1. 该网站有 2 个不同类型的内容: 和 quotepost
  2. 该网站有 2 种对内容分类的方法:categoriestags.
  3. 该网站有 3 中不同的视图: list, summary 和full page view.

你可能感兴趣的:(Hugo Doc - Source Organization)