Title
Contents
前提条件
- Hugo (静的サイトジェネレータ) + Github Pages/actionsを利用する。
- GitHub actionsで自動デプロイ
- GItHub actionsのactions/upload-pages-artifact@v2アクションを利用して./publicをアーティファクトとしてアップロードする。
テスト画像とマークダウンの準備
テスト用の画像を2個用意して、検証する。test.md
- content/posts/test.mdに画像を表示する。
- content/images/test_1.PNG を用意する。
- content/posts/images/test_2.PNG を用意する。
ディレクトリ構成
├── content
│ ├── posts
│ | ├── test.md
│ │ └── images
│ │ └── test_2.PNG
│ ├── images
│ │ └── test_1.PNG
相対パスで指定する(github pagesで表示できない)
マークダウン記載方法


◆結果
ローカルでは表示できるが、github pagesでは表示できない。
URLで指定する
環境に合わせて、<ユーザ名>、<リポジトリ名>と<content以下のイメージファイルまでのパス>をかきかえてください。

ブラウザで画像を見ることができるか確認する。 https://ancient-blog.github.io/hugo.github.io/images/test_1.PNG
例) test.md

https://ancient-blog.github.io/hugo.github.io/images/test_1.PNG
◆結果
github pagesでも上記画像を表示することができた。