A grid layout
This commit is contained in:
parent
d281f22242
commit
ce530b20a1
6 changed files with 168 additions and 54 deletions
|
@ -1,11 +1,15 @@
|
|||
{{ $id := .Get "id" }}
|
||||
{{ .Page.Scratch.Set "includes_railroad_diagram" true }}
|
||||
{{ if not (in (.Page.Scratch.Get "railroad_diagram_ids") $id) }}
|
||||
{{ .Page.Scratch.Add "railroad_diagram_ids" (slice $id) }}
|
||||
<div class="centered">
|
||||
<figure class="railroad-diagram" {{ if $id }}id="{{ $id }}"{{ end }}></figure>
|
||||
</div>
|
||||
{{ end }}
|
||||
<script defer type="module">
|
||||
import { railroadDiagram } from {{ `/scripts/railroad-utils.js` | relURL }};
|
||||
const className = {{ with .Get "class" }}{{ . | string }}{{ else }}undefined{{ end }};
|
||||
railroadDiagram(rr => {
|
||||
{{ .Inner | safeJS }}
|
||||
}, "{{ $id }}");
|
||||
}, "{{ $id }}", className);
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue