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.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.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章