Template for shortcode not found

Hello everyone,

I’m working on a site for a TTRPG. I read the page on creating shortcodes, but I keep getting “failed to extract shortcode: template for shortcode “ability” not found.” However, I’m not seeing what I’m doing wrong, maybe something obvious?

I have this shortcode, “ability”. I’ve tried putting it under layout\_shortcodes\_ability.html, layout\shortcodes\ability.html, layout\shortcodes\_ability.html, and layout\_shortcodes\ability.html, yet it’s still not finding it. Here’s the contents and a usage of it (of which usage I’ve tried both % and <>)

<div class="ability-container">
	<div class="ability-title">
		{{ with .Get "name" }}<strong>{{ . }}</strong>{{ end }}
	</div>
	<div class="ability-stats">
		{{ with .Get "ap" }}<span><strong>AP:</strong> {{ . }}</span>{{ end }}
	</div>
	<div class="ability-description">
		{{ .Inner | safeHTML }}
	</div>
</div>
{{% ability name="Dash" ap="2" %}}
For this turn, you are able to move twice your Speed. Can only be used once per turn.
{{% /ability %}}

I also have an assets\ability.scss for the shortcode. Any help would be appreciated, thank you! I can’t quite figure out what I did wrong from reading the shortcode documentation, so I must be acting stupid and missing something terribly obvious lol.

I figured it out, I just had to restart the server with _shortcodes\ability.html. The server kind of bugged out not wanting to recompile it while running. Solved! Just restart the server c:

I also noticed the server throws the same error if I declare a shortcode in markdown files before creating the template, and the error persists even after creating it. I have to restart the server to resolve the issue.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.