gic.config.yaml の設定
gic.config.yaml の設定
このページでは gic.config.yaml
の設定について説明します。
全体構成
gic.config.yaml
は以下のような構成になっています。
github:
username: 'rokuosan'
repository: 'github-issue-cms'
hugo:
filename:
articles: '%Y-%m-%d_%H%M%S.md'
images: '[:id].png'
directory:
articles: 'content/posts'
images: 'static/images/%Y-%m-%d_%H%M%S'
url:
images: '/images/%Y-%m-%d_%H%M%S'
設定項目
github
GitHub の設定です。
username
: GitHub のユーザー名repository
: Issue を取得するリポジトリ名
hugo
Hugo の設定です。
filename
articles
: 記事のファイル名images
: 画像のファイル名
[:id]
は画像の ID に置き換わります。画像の ID はそのIssue内部で一意で、連番で割り振られます。
directory
articles
: 記事の保存先ディレクトリimages
: 画像の保存先ディレクトリ
url
images
: Markdownから参照される画像のURL
プレースホルダ
gic.config.yaml
では以下のプレースホルダを利用できます。
%Y
: 年%m
: 月%d
: 日%H
: 時%M
: 分%S
: 秒
これらのプレースホルダは、strftime
と同様の書式で利用できます。
設定例
Hugo のページバンドルを使う場合
gic.config.yaml
hugo:
filename:
articles: 'index.md'
images: '[:id].png'
directory:
articles: 'content/posts/%Y-%m-%d_%H%M%S'
images: 'content/posts/%Y-%m-%d_%H%M%S'
url:
images: ''
出力例
- index.md
- 0.png
- index.md
- 0.png
最終更新日