Home → Bikeshed → Components
showFile.html
Shortcode
Published: Updated:
A “meta” shortcode which I use to show the contents of a specific file I use on this site and applies syntax highlighting to it. For some reason I can’t use syntax highlighting via code fences in markdown so you’ll need to use the highlight shortcode.
Arguments
{{< showFile path="" lang="" >}}
path
is the file you want to show (from project root including mounts)lang
is the file type. By default it is inferred by the file extension.
Source Code
Very meta.
{{- readFile (.Get "path") | safeHTML -}}