feat: add 'aside' as a shortcode (#6)

The README has been updated to show a code example of both, including an
exemplary screenshot.

Since Hugo 0.55, we have to use `markdownify` in shortcodes that contain
HTML elements. At least we have to, if we want to render markdown code
inside the HTML element.

To use the `<aside>` element, we have to wrap our content in an
`<article>` tag.

This fixes #4.

Co-authored-by: Robert Lützner <robert.luetzner@iternity.com>
This commit is contained in:
Robert Lützner 2023-02-23 20:04:33 +00:00 committed by GitHub
parent 82e5f2ccab
commit 80cd7cf8f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 3 deletions

View file

@ -2,5 +2,7 @@
<h1>{{ .Title }}</h1>
{{ partial "metadata.html" . }}
<!-- <br><br> -->
<article>
{{ .Content }}
{{ end }}
</article>
{{ end }}

View file

@ -1,5 +1,7 @@
{{ define "main" }}
{{ partial "metadata.html" . }}
<!-- <br><br> -->
<article>
{{ .Content }}
{{ end }}
</article>
{{ end }}

View file

@ -0,0 +1 @@
<aside>{{ .Inner | markdownify }}</aside>