hobby-gadget オススメ、コーヒーショップまとめの記事で、Slackの投稿を引用する際、それなりにいい感じに表示させるためのHugo shortcodeを書いたので共有しておきます。 ショートコード # Shortcodes | Hugoを参考にして、layouts/shortcodes/slack.htmlに、下記の内容のshortcodeファイルを作成しました。 {{- $who := .Get "who" -}} {{- $githubName := .Get "githubName" -}} {{- $time := .Get "time" -}} {{- $link := .Get "link" -}} {{- $content := .Get "content" -}} <blockquote class="slack-widget" {{- if $link -}}
![Slackからの引用をいい感じに表示するHugoショートコード](https://cdn-ak-scissors.b.st-hatena.com/image/square/cae8b188cf7c61292b0548ffe1f84d569ca77702/height=288;version=1;width=512/https%3A%2F%2Fblog.tomoya.dev%2Fposts%2Fhugo-shortcode-for-slack-post%2Fslack-shortcode-example.png)