概要

hugoコマンド実行時に以下のタスクが実行される contentのmdファイルをsingle.htmlを使ってhtmlに変換する(1対1) contentのサブフォルダをsectionと呼ぶ。sectionのサブフォルダはsectionにならない sectionのindex.htmlをlist.htmlで生成する topのindex.htmlをindex.htmlまたはlist.htmlで生成する(サイト全体で1)

+-------+
|layouts|
+-------+
|
v

content -----+-------> public / (index.html or list.html) -> index.html

  • post + post / (list.html) -> index.html
    • 2017 + 2017
      • 05 + 05
        • article1.md + article1 / (single.html) -> index.html
        • article2.md + article2 / (single.html) -> index.html
        • article3.md + article3 / (single.html) -> index.html

contentフォルダの構成

Directory structure
Each Hugo project is a directory, with subdirectories that contribute to the content, structure, behavior, and presentation of your site.
Directory structure favicon https://gohugo.io/overview/source-directory/#content-for-home-page-and-other-list-pages
Directory structure

個別記事(single content)のmdをhtmlに変換する

Templates
Go templating, template types and lookup order, shortcodes, and data.
Templates favicon https://gohugo.io/templates/content/
Templates

個々のページをhtmlに変換(render)するときにどのTemplateを選択するのかについての説明が上記にある。 デフォルトは /themes/THEME/layouts/_default/single.htmlが使われる。 セクション毎にセクション内の記事のリスト(list content)のhtmlを生成する

Lists of content in Hugo
Lists have a specific meaning and usage in Hugo when it comes to rendering your site homepage, section page, taxonomy list, or taxonomy terms list.
Lists of content in Hugo favicon https://gohugo.io/templates/list/
Lists of content in Hugo

セクションページのhtmlを生成するときにどのTemplateを選択するのかについての説明が上記にある。 デフォルトは/themes/THEME/layouts/_default/list.htmlが使われる。 サイトトップのhtmlを生成する

Homepage template
The homepage of a website is often formatted differently than the other pages. For this reason, Hugo makes it easy for you to define your new site's homepage as a unique template.
Homepage template favicon https://gohugo.io/templates/homepage/
Homepage template

サイトトップのhtmlを生成するときにどのTemplateを選択するのかについての説明が上記にある。 以下の順に選択される。

/themes/THEME/layouts/index.html /themes/THEME/layouts/_default/list.html /themes/THEME/layouts/_default/single.html