Skip to content

Instantly share code, notes, and snippets.

@moxak
Created June 5, 2022 11:22
Show Gist options
  • Save moxak/202150a70a4679abdb3efe7a9cdd84c3 to your computer and use it in GitHub Desktop.
Save moxak/202150a70a4679abdb3efe7a9cdd84c3 to your computer and use it in GitHub Desktop.
Hugo: layouts/_default/_markup/に設置するテンプレートファイル。コードブロックの名前を表示するdivタグを追加する。
<div>
{{- $name := .Attributes.name -}}
{{ with $name }}<div class="codeblock--name">{{ . }}</div>{{ end }}
<div class="codeblock--content">
{{- highlight (.Inner | safeHTML) .Type .Options }}
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment