Replacement for Hugo shortcodes

So I think the answer to this is a custom plugin/Kirbytag, but I’m not sure how to put it together and use it. I’m looking to duplicate Hugo’s shortcode functionality in Kirby, such that I can enter the tag in the post content and have it expanded behind the scenes. As an example from my Tufte theme, the epigraph code:

<div class="epigraph">
		{{ $t := .Get "type" }}
		{{ if eq $t "compact"  }}{{ .Inner | markdownify }}{{ else }}<p>{{ .Inner | markdownify }}</p>{{ end }}
		{{ if .IsNamedParams }}
				{{ with .Get "pre" }}{{ . }}{{ end }}
{{ with .Get "link" | safeURL | markdownify }}<a href={{ . }} target="_blank" rel="noopener">{{ end }}
				{{ with .Get "cite" }}<cite>{{ . }}</cite>{{ end }}
				{{ if .Get "link"}}</a>{{ end }}
				{{ with .Get "post" }}{{ . }}{{ end }}
		{{ end }}

This is what gets produced from the following shortcode syntax within the post itself:

{{< epigraph pre="Person's Name" cite="Site Name" link="//" >}}blockquote text goes here{{< /epigraph >}}

Where and how do I create the Kirby equivalent for this, and deploy it within blog post content? I think once I’ve gotten one of these down, the rest should be straightforward.

Forgive my still noob-ness. :wink:

(Edit: And yes, there’s a higher than zero percent chance I’m planning on porting Tufte to Kirby.)

The equivalent are indeed Kirbytags, you create them in a plugin, see docs: KirbyTags | Kirby CMS.

Some examples of custom Kirbytags: at main · getkirby/ · GitHub

The built-in KirbyTags might also help as a starting point: kirby/config/tags.php at main · getkirby/kirby · GitHub.

Thanks, Sonja. Glad to know I’m on the right track, and I appreciate the links so I can try and learn this myself. Some of what I learned in my PHP course from first year college is coming back to me, but if I get stuck I’ll check back here.