Home → The Classics → The Classic Bikeshed Posts
test-case.html
Shortcode
Published:
Just a helper shortcode which runs some code and outputs the result.
Code
Sample Code
{{ highlight (trim .Inner "\r\n ") (.Get "inlang" ) -}}Resulting Code
{{ highlight (.Page.RenderString .Inner) (.Get "outlang" ) }} {{ if .Get "showResult" -}} {{ .Page.RenderString .Inner }} {{- end }}Test Case
There isn’t one since it wasn’t as useful as I thought it would be. If I tried using a shortcode, it will only show the rendered content and not the raw one.
TODO
- Figure out how to handle testing shortcodes