layouts: tikz: allow using file input
Makes it easier to handle big diagrams.
This commit is contained in:
parent
879b671332
commit
a6bbb10098
|
@ -1,3 +1,16 @@
|
||||||
<script type="text/tikz">
|
<script type="text/tikz">
|
||||||
{{.Inner}}
|
{{ with .Get "file" }}
|
||||||
|
{{ if eq (. | printf "%.1s") "/" }}
|
||||||
|
{{/* Absolute path are from root of site. */}}
|
||||||
|
{{ $.Scratch.Set "filepath" . }}
|
||||||
|
{{ else }}
|
||||||
|
{{/* Relative paths are from page directory. */}}
|
||||||
|
{{ $.Scratch.Set "filepath" $.Page.File.Dir }}
|
||||||
|
{{ $.Scratch.Add "filepath" . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ $.Scratch.Get "filepath" | readFile }}
|
||||||
|
{{ else }}
|
||||||
|
{{.Inner}}
|
||||||
|
{{ end }}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue