website/content/posts/2023-04-10-asciidoc-go-template-and-hugo-featuring-nix/assets/hugo-shortcode-chat.html

13 lines
541 B
HTML

\{{ $avatar := default (.Get "avatar") (.Get 0) }}
{{ $name := default $avatar (.Get "name") }}
{{ $state := default "default" (.Get "state") }}
<div class="dialogblock dialogblock__avatar--{{ anchorize $avatar }} {{ with .Get "reversed" }}reversed{{ end }}" title="{{ $name }}">
<div class="dialogblock dialogblock__avatar">
<img src="/icons/avatars/{{ anchorize $avatar }}/{{ anchorize $state }}.webp" alt="{{ $name }}"/>
</div>
<div class="dialogblock dialogblock__text">
{{ $.Page.RenderString .Inner }}
</div>
</div>