title |
---|
Test HTML and JS Embed! |
This should have the content of test.html
below here:
{{< embed src="/resources/test.html" >}}
And the js should be inserted below here:
{{< embed src="/resources/test.js" js="true" >}}
Hooray üéâ
<div class="embed"> | |
{{ $file := .Get "src" }} | |
{{ if fileExists $file }} | |
{{ if eq (.Get "markdown") "true" }} | |
{{ $file | readFile | markdownify }} | |
{{ else }} | |
{{ if or (eq (.Get "javascript") "true") (eq (.Get "js") "true") }} | |
<script> | |
{{ $file | readFile | safeJS }} | |
</script> | |
{{ else }} | |
{{ $file | readFile | safeHTML }} | |
{{ end }} | |
{{ end }} | |
{{ else }} | |
<p><em>Cannot find file <code>{{ $file }}</code></em></p> | |
{{ end }} | |
</div> |
title |
---|
Test HTML and JS Embed! |
This should have the content of test.html
below here:
{{< embed src="/resources/test.html" >}}
And the js should be inserted below here:
{{< embed src="/resources/test.js" js="true" >}}
Hooray üéâ