You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
714B

  1. <!-- {{/*
  2. Named attributes: "type", "file"
  3. Positional params: 0 {file}
  4. With base64-encoded inline image in markdown:
  5. ![Theme screenshots](data:image/png;base64,{{< include type="image" file="themes/after-dark/images/docs/minimal-mac.png" >}})
  6. Combined with highlight shortcode for syntax highlighting:
  7. {{< highlight shell "linenos=inline" >}}
  8. {{< include "themes/after-dark/bin/install" >}}
  9. {{< /highlight >}}
  10. */}} -->
  11. {{- $type := .Get "type" }}
  12. {{- $file := .Get "file" }}
  13. {{- if and .IsNamedParams }}
  14. {{- if eq $type "image" }}{{ readFile $file | base64Encode }}{{ end -}}
  15. {{- if eq $type "source" }}{{ readFile $file | safeHTML }}{{ end -}}
  16. {{ else }}
  17. {{- readFile (.Get 0) | safeHTML -}}
  18. {{ end -}}