Hugo
#Headless_CMS
#go
https://github.com/gohugoio/hugo
go
Open source project向けのテーマなど、テーマがいろいろある
Hugo
https://gohugo.io/getting-started/usage/
quick start
https://gohugo.io/getting-started/quick-start/
クイックスタート通りに実行
sakura blog
https://knowledge.sakura.ad.jp/22908/
code:hugo
# build
hugo -D
Site Configuration
code:config.toml
baseURL = "https://example.org/"
languageCode = "en-us"
title = "My New Hugo Site" #サイトタイトル
theme = "ananke" # themeディレクトリ以下のthemeを指定
Type
contentディレクトリ以下のディレクトリ名
含まれるファイルはそのサブディレクトリ含めそのタイプとなる
archetypes
https://gohugo.io/content-management/archetypes/
タイプごとのテンプレート
postならpost-defaultでバンドルにできるみたい。
code:archetyes
# Directory based archetypes
archetypes
├── default.md
└── post-bundle
├── bio.md
├── images
│ └── featured.jpg
└── index.md
mdファイル
toml,yaml形式で記述
Front Matter Variables
メタデータ
「---」はYAML
「+++」はTOML形式
{}で囲めばJSON形式
taxonomyを指定可能
code:taxonomies.toml
tag = "tags"
category = "categories"
author = "authors"
上部メニュー表示の設定
code:menu.toml
menu.main
identifier = "news"
name = "news"
url = "/news/"
menu.main
identifier = "posts"
name = "posts"
url = "/posts/"
-----
Modules
https://gohugo.io/hugo-modules/
install
https://gohugo.io/hugo-modules/use-modules/
content
https://gohugo.io/content-management/organization
ファイル名とパスが一致している
Switching From WordPress To Hugo
https://www.smashingmagazine.com/2019/05/switch-wordpress-hugo/
Hugoが使用されているプロジェクト
lets encrypt
https://github.com/letsencrypt/website