Restructure all pages under article tag

master
Will Faught 3 years ago
parent 6356e860e4
commit f74704bb8a

@ -30,6 +30,10 @@
<link href="{{ .Permalink }}" rel="{{ .Rel }}" title="{{ $.Site.Title }}" type="{{ .MediaType.Type }}"> <link href="{{ .Permalink }}" rel="{{ .Rel }}" title="{{ $.Site.Title }}" type="{{ .MediaType.Type }}">
{{ end }} {{ end }}
<style> <style>
article > div {
margin-bottom: 1rem;
}
blockquote { blockquote {
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
border-left: 0.25rem solid #e9ecef; border-left: 0.25rem solid #e9ecef;
@ -39,55 +43,35 @@
blockquote p:last-of-type { blockquote p:last-of-type {
margin-bottom: 0; margin-bottom: 0;
} }
#content div {
margin-bottom: 1rem;
}
</style> </style>
{{ if templates.Exists "partials/head.html" }} {{ if templates.Exists "partials/head.html" }}
{{ partial "head" . }} {{ partial "head.html" . }}
{{ end }} {{ end }}
</head> </head>
<body class="d-flex flex-column"> <body class="d-flex flex-column">
<div class="container flex-fill"> <div class="container flex-fill">
{{ if .Site.Menus.main }} <div class="row">
<header> <div class="col">
<div class="row"> {{ if .Site.Menus.main }}
<div class="col"> <header>
<nav class="d-flex justify-content-center my-3"> {{ partial "paige_menus.html" . }}
<ul class="justify-content-center nav nav-pills"> </header>
{{ $p := . }} {{ end }}
{{ $basePath := path.Clean (urls.Parse .Site.BaseURL).Path }} <main>
{{ if eq $basePath "/" }} <article>
{{ $basePath = "" }} {{ block "main" . }}{{ end }}
{{ end }} </article>
{{ range .Site.Menus.main }} </main>
{{ $pagePath := strings.TrimPrefix $basePath $p.RelPermalink }} {{ if .Site.Copyright }}
{{ $menuPath := strings.TrimPrefix $basePath .URL }} <footer>
{{ $active := or (and (eq $menuPath `/`) (eq $pagePath `/`)) (and (ne $menuPath `/`) (hasPrefix $pagePath $menuPath)) }} <p class="text-center text-muted">{{ .Site.Copyright | markdownify }}</p>
<li class="nav-item"><a href="{{ .URL }}" class="nav-link{{if $active }} active{{ end }}">{{ .Name }}</a></li> </footer>
{{ end }} {{ end }}
</ul>
</nav>
</div>
</div> </div>
</header> </div>
{{ end }}
<main>
{{ block "main" . }}{{ end }}
</main>
{{ if .Site.Copyright }}
<footer>
<div class="justify-content-center row">
<div class="col col-auto">
<p class="text-muted">{{ .Site.Copyright | markdownify }}</p>
</div>
</div>
</footer>
{{ end }}
</div> </div>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"></script> <script crossorigin="anonymous" defer integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>
{{ if or .Params.math .Site.Params.math }} {{ if or .Site.Params.math .Params.math }}
<script crossorigin="anonymous" defer integrity="sha384-97gW6UIJxnlKemYavrqDHSX3SiygeOwIZhwyOKRfSaf0JWKRVj9hLASHgFTzT+0O" src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.js"></script> <script crossorigin="anonymous" defer integrity="sha384-97gW6UIJxnlKemYavrqDHSX3SiygeOwIZhwyOKRfSaf0JWKRVj9hLASHgFTzT+0O" src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.js"></script>
<script crossorigin="anonymous" defer integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" onload="renderMathInElement(document.body);" src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js"></script> <script crossorigin="anonymous" defer integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" onload="renderMathInElement(document.body);" src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js"></script>
{{ end }} {{ end }}
@ -95,7 +79,7 @@
{{ template "_internal/google_analytics.html" . }} {{ template "_internal/google_analytics.html" . }}
{{ end }} {{ end }}
{{ if templates.Exists "partials/body.html" }} {{ if templates.Exists "partials/body.html" }}
{{ partial "body" . }} {{ partial "body.html" . }}
{{ end }} {{ end }}
</body> </body>
</html> </html>

@ -1,56 +1,47 @@
{{ define "main" }} {{ define "main" }}
{{ if or .Title .Description }} {{ if .Title }}
<div class="row"> <h1 class="display-1 fw-bold text-center">
<div class="col text-center"> {{ if .Params.link }}
{{ if .Title }} <a href="{{ .Params.link }}">{{ .Title | markdownify }}</a>
<h1 class="display-1 fw-bold">{{ .Title | markdownify }}</h1> {{ else }}
{{ end }} {{ .Title | markdownify }}
{{ if .Description }} {{ end }}
<p class="lead">{{ .Description | markdownify }}</p> </h1>
{{ end }} {{ end }}
</div> {{ if .Description }}
</div> <p class="lead text-center">{{ .Description | markdownify }}</p>
{{ end }}
{{ if .PublishDate }}
<p class="text-center text-muted"><time datetime="{{ .PublishDate.Format `2006-01-02` }}">{{ .PublishDate.Format "January 2, 2006" }}</time></p>
{{ end }} {{ end }}
{{ if .Params.stretch }} {{ if .Params.stretch }}
<div class="row"> <div class="rounded-4 shadow" style="background-image: url('{{ relURL .Params.stretch }}'); background-position: center; background-size: cover; height: 20rem; max-width: 100%"></div>
<div class="col pb-3 text-center">
<div class="rounded-4 shadow" style="background-image: url('{{ relURL .Params.stretch }}'); background-position: center; background-size: cover; height: 20rem; max-width: 100%"></div>
</div>
</div>
{{ end }} {{ end }}
{{ if .Params.center }} {{ if .Params.center }}
<div class="row"> <p class="text-center">
<div class="col pb-3 text-center"> <img class="rounded-4 shadow" src="{{ relURL .Params.center }}" style="max-height: 20rem; max-width: 100%">
<img class="rounded-4 shadow" src="{{ relURL .Params.center }}" style="max-height: 20rem; max-width: 100%"> </p>
</div>
</div>
{{ end }} {{ end }}
{{ if .Params.greeting }} {{ if .Params.greeting }}
<div class="row"> <h2 class="display-5 fw-bold text-center">{{ .Params.greeting | markdownify }}</h2>
<div class="col text-center">
<h2 class="display-5 fw-bold">{{ .Params.greeting | markdownify }}</h2>
</div>
</div>
{{ end }} {{ end }}
{{ if .Params.blurb }} {{ if .Params.blurb }}
<div class="row"> <section>
<div class="col col-lg-6 mx-auto text-center"> <div class="col col-xl-6 mx-auto">
<p class="lead">{{ .Params.blurb | markdownify }}</p> <p class="lead text-center">{{ .Params.blurb | markdownify }}</p>
</div> </div>
</div> </section>
{{ end }} {{ end }}
{{ if .Content }} {{ if .Content }}
<div class="row"> {{ .Content }}
<div class="col">{{ .Content }}</div>
</div>
{{ end }} {{ end }}
{{ if .Site.Social }} {{ if .Site.Social }}
<div class="row"> <section>
<div class="col pb-3 text-center"> <div class="pb-3 text-center">
{{ range $k, $v := .Site.Social }} {{ range $k, $v := .Site.Social }}
<a href="{{ $v }}"><i class="bi bi-{{ $k }} display-6 px-2"></i></a> <a href="{{ $v }}"><i class="bi bi-{{ $k }} display-6 px-2"></i></a>
{{ end }} {{ end }}
</div> </div>
</div> </section>
{{ end }} {{ end }}
{{ end }} {{ end }}

@ -1,70 +1,4 @@
{{ define "main" }} {{ define "main" }}
<section> {{ partial "paige_content.html" . }}
{{ if or .Title .Description }} {{ partial "paige_pages.html" . }}
<header>
<div class="row text-center justify-content-center">
<div class="col">
{{ if .Title }}
<h1 class="display-5 fw-bold">
{{ if .Params.link }}
<a href="{{ .Params.link }}">{{ .Title | markdownify }}</a>
{{ else }}
{{ .Title | markdownify }}
{{ end }}
</h1>
{{ end }}
{{ if .Description }}
<p class="lead">{{ .Description | markdownify }}</p>
{{ end }}
</div>
</div>
</header>
{{ end }}
{{ if .Content }}
<div class="row">
<div class="col">
<div class="mx-auto">
{{ .Content }}
</div>
</div>
</div>
{{ end }}
{{ if .Pages }}
{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
<section>
<div class="row">
<div class="col">
<div class="mx-auto text-center">
{{ range $p.PageGroups }}
<h5>{{ .Key }}</h5>
{{ range .Pages }}
<p>
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
{{- if .Description -}}
<br/>
{{- .Description | markdownify -}}
{{- end -}}
</p>
{{ end }}
{{ end }}
</div>
</div>
</div>
</section>
{{ if or $p.HasPrev $p.HasNext }}
<footer>
<div class="row">
<div class="col">
<div class="d-flex justify-content-center pt-3">
{{ partial "pagination" . }}
</div>
</div>
</div>
</footer>
{{ end }}
{{ end }}
{{ if not (or .Content .Pages) }}
<p class="lead text-center">Nothing here</p>
{{ end }}
</section>
{{ end }} {{ end }}

@ -1,40 +1,3 @@
{{ define "main" }} {{ define "main" }}
{{ if not (or .Title .Description .PublishDate .Content) }} {{ partial "paige_content.html" . }}
<section>
<h1 class="display-5 fw-bold text-center">Nothing Here</h1>
</section>
{{ else }}
<article>
{{ if or .Title .Description .PublishDate }}
<header>
<div class="justify-content-center row">
<div class="col col-auto text-center">
{{ if .Title }}
<h1 class="display-5 fw-bold">
{{ if .Params.link }}
<a href="{{ .Params.link }}">{{ .Title | markdownify }}</a>
{{ else }}
{{ .Title | markdownify }}
{{ end }}
</h1>
{{ end }}
{{ if .Description }}
<p class="lead">{{ .Description | markdownify }}</p>
{{ end }}
{{ if .PublishDate }}
<p class="text-muted"><time datetime="{{ .PublishDate.Format `2006-01-02` }}">{{ .PublishDate.Format "January 2, 2006" }}</time></p>
{{ end }}
</div>
</div>
</header>
{{ end }}
{{ if .Content }}
<div class="justify-content-center row">
<div class="col col-auto" id="content">
{{ .Content }}
</div>
</div>
{{ end }}
</article>
{{ end }}
{{ end }} {{ end }}

@ -1,40 +1,14 @@
{{ define "main" }} {{ define "main" }}
{{ if not (or .Title .Pages) }} {{ partial "paige_content.html" . }}
{{ if .Pages }}
<section> <section>
<h1 class="display-5 fw-bold text-center">Nothing Here</h1> <ul class="list-inline text-center">
</section> {{ range (sort .Pages "Title") }}
{{ else }} <li class="list-inline-item">
<section> <a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
{{ if .Title }} </li>
<header> {{ end }}
<div class="row text-center"> </ul>
<div class="col">
<h1 class="display-5 fw-bold">
{{ if .Params.link }}
<a href="{{ .Params.link }}">{{ .Title | markdownify }}</a>
{{ else }}
{{ .Title | markdownify }}
{{ end }}
</h1>
</div>
</div>
</header>
{{ end }}
{{ if .Pages }}
<div class="row">
<div class="col">
<div class="mx-auto text-center">
<ul class="list-inline">
{{ range (sort .Pages "Title") }}
<li class="list-inline-item">
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
</div>
</div>
</div>
{{ end }}
</section> </section>
{{ end }} {{ end }}
{{ end }} {{ end }}

@ -1,34 +1,4 @@
{{ define "main" }} {{ define "main" }}
<section> {{ partial "paige_content.html" . }}
<header> {{ partial "paige_pages.html" . }}
<div class="row text-center justify-content-center">
<div class="col">
<h1 class="display-5 fw-bold">
{{ .Title }}
</h1>
</div>
</div>
</header>
{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
<section>
<div class="row">
<div class="col">
<div class="mx-auto text-center">
{{ range $p.PageGroups }}
<h5>{{ .Key }}</h5>
{{ range .Pages }}
<p>
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
{{- if .Description -}}
<br/>
{{- .Description | markdownify -}}
{{- end -}}
</p>
{{ end }}
{{ end }}
</div>
</div>
</div>
</section>
</section>
{{ end }} {{ end }}

@ -0,0 +1,18 @@
{{ if .Title }}
<h1 class="display-5 fw-bold text-center">
{{ if .Params.link }}
<a href="{{ .Params.link }}">{{ .Title | markdownify }}</a>
{{ else }}
{{ .Title | markdownify }}
{{ end }}
</h1>
{{ end }}
{{ if .Description }}
<p class="lead text-center">{{ .Description | markdownify }}</p>
{{ end }}
{{ if .PublishDate }}
<p class="text-center text-muted"><time datetime="{{ .PublishDate.Format `2006-01-02` }}">{{ .PublishDate.Format "January 2, 2006" }}</time></p>
{{ end }}
{{ if .Content }}
{{ .Content }}
{{ end }}

@ -0,0 +1,15 @@
<nav class="d-flex justify-content-center py-3">
<ul class="justify-content-center nav nav-pills">
{{ $p := . }}
{{ $basePath := path.Clean (urls.Parse .Site.BaseURL).Path }}
{{ if eq $basePath "/" }}
{{ $basePath = "" }}
{{ end }}
{{ range .Site.Menus.main }}
{{ $pagePath := strings.TrimPrefix $basePath $p.RelPermalink }}
{{ $menuPath := strings.TrimPrefix $basePath .URL }}
{{ $active := or (and (eq $menuPath `/`) (eq $pagePath `/`)) (and (ne $menuPath `/`) (hasPrefix $pagePath $menuPath)) }}
<li class="nav-item"><a href="{{ .URL }}" class="nav-link{{if $active }} active{{ end }}">{{ .Name }}</a></li>
{{ end }}
</ul>
</nav>

@ -0,0 +1,22 @@
{{ if .Pages }}
<section>
{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
{{ range $p.PageGroups }}
<h5 class="text-center">{{ .Key }}</h5>
{{ range .Pages }}
<p class="text-center">
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
{{ if .Description }}
<br>
{{ .Description | markdownify }}
{{ end }}
</p>
{{ end }}
{{ end }}
{{ if or $p.HasPrev $p.HasNext }}
<div class="d-flex justify-content-center pt-3">
{{ partial "pagination.html" . }}
</div>
{{ end }}
</section>
{{ end }}
Loading…
Cancel
Save