gic.config.yaml の設定

gic.config.yaml の設定

このページでは gic.config.yaml の設定について説明します。

全体構成

gic.config.yaml は以下のような構成になっています。

github:
  username: 'rokuosan'
  repository: 'github-issue-cms'
  labels:
    - 'article'

output:
  articles:
    directory: 'content/posts'
    filename: '%Y-%m-%d_%H%M%S.md'
  images:
    directory: 'static/images/%Y-%m-%d_%H%M%S'
    filename: '[:id].png'
    url: '/images/%Y-%m-%d_%H%M%S'

設定項目

github

GitHub の設定です。

  • username: GitHub のユーザー名
  • repository: Issue を取得するリポジトリ名
  • labels: 指定したラベルをすべて持つ Issue のみ取得

output

出力先の設定です。

articles

  • directory: 記事の保存先ディレクトリ
  • filename: 記事のファイル名

images

  • directory: 画像の保存先ディレクトリ
  • filename: 画像のファイル名
  • url: Markdownから参照される画像のURL

[:id] は画像の ID に置き換わります。画像の ID はそのIssue内部で一意で、連番で割り振られます。

プレースホルダ

gic.config.yaml では以下のプレースホルダを利用できます。

  • %Y: 年
  • %m: 月
  • %d: 日
  • %H: 時
  • %M: 分
  • %S: 秒

これらのプレースホルダは、strftime と同様の書式で利用できます。

設定例

Hugo のページバンドルを使う場合

gic.config.yaml

output:
  articles:
    directory: 'content/posts/%Y-%m-%d_%H%M%S'
    filename: 'index.md'
  images:
    directory: 'content/posts/%Y-%m-%d_%H%M%S'
    filename: '[:id].png'
    url: ''

出力例

        • index.md
        • 0.png
        • index.md
        • 0.png
  • 最終更新日