このテーマ内でサイト内ブログカードを作れる「self-blog-card」というショートコードを作成しました。
使い方
- 自サイト内のurlを指定します
- 自記事のブログカードは表示できません。
- 日本語だとconfig.ymlの
summaryLength: 200
以上推奨です
{{< self-blog-card "/article/salt/custom-figure" >}}
表示例

このテーマ内でサイト内ブログカードを作れる「self-blog-card」というショートコードを作成しました。
summaryLength: 200
以上推奨です
{{< self-blog-card "/article/salt/custom-figure" >}}
このテーマ内で画像のリサイズ・トリミングができる「custom-figure」というショートコードを作成しました。
Image Processingについてはこちらをチェック
Resize, crop, rotate, filter, and convert images.
{{< custom-figure src="image.png" title="Resize スイカ" Resize="320x180" >}}
{{< custom-figure src="image.png" title="Fit スイカ" Fit="320x180" >}}
{{< custom-figure src="image.png" title="Fill スイカ" Fill="320x180" >}}
{{< custom-figure src="image.png" title="Crop スイカ" Crop="320x180" >}}
元画像は512x512です
Hugoで用意されているショートコード使用時の表示サンプルです
※このgistショートコードはHugoのバージョン0.143.0で非推奨となり、将来のリリースで削除予定なので Hugo Theme Salt内のショートコードに移行しました
<section id="main">
<div>
<h1 id="title">{{ .Title }}</h1>
{{ range .Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
</section>
Owl bet you'll lose this staring contest 🦉 pic.twitter.com/eJh4f2zncC