A grid layout

This commit is contained in:
Eryn Wells 2022-08-31 20:11:59 -07:00
parent d281f22242
commit ce530b20a1
6 changed files with 168 additions and 54 deletions

View file

@ -3,11 +3,13 @@
{{ partial "head.html" . }}
<body class="not-ready" data-menu="{{ isset site.Menus `main` }}">
{{ partial "header.html" . }}
<main class="main">
{{ block "main" . }}{{ end }}
</main>
{{ partial "footer.html" . }}
<div id="page-container">
{{ partial "header.html" . }}
<main id="page-main" class="main">
{{ block "main" . }}{{ end }}
</main>
{{ partial "footer.html" . }}
</div>
</body>
{{ if and .IsPage (.Page.Scratch.Get "includes_railroad_diagram") }}

View file

@ -1,5 +1,5 @@
{{ define "main" }}
<article class="post-single">
<article class="single">
<header>
{{ partial "development/draft_tag.html" . }}
<div class="post-title">
@ -7,11 +7,11 @@
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
</div>
</header>
<section class="post-content">
<section>
{{ .Content }}
</section>
<!-- Post Tags -->
{{ if .Params.tags }}
<footer>
<ul class="post-tags">
@ -19,19 +19,18 @@
<li><a href="{{ $href }}">{{ . }}</a></li>
{{ end }}
</ul>
</footer>
{{ end }}
<!-- Post Nav -->
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
{{ if and (gt (len $pages) 1) (in $pages . ) }}
<nav class="post-nav">
{{ with $pages.Next . }}
<a class="prev" href="{{ .Permalink }}"><span></span><span>{{ .Name }}</span></a>
{{ end }} {{ with $pages.Prev . }}
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span></span></a>
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
{{ if and (gt (len $pages) 1) (in $pages . ) }}
<nav class="post-nav">
{{ with $pages.Next . }}
<a class="prev" href="{{ .Permalink }}"><span></span><span>{{ .Name }}</span></a>
{{ end }} {{ with $pages.Prev . }}
<a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span></span></a>
{{ end }}
</nav>
{{ end }}
</nav>
</footer>
{{ end }}
</article>
{{ end }}

View file

@ -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>