Restructure all pages under article tag
This commit is contained in:
@@ -30,6 +30,10 @@
|
||||
<link href="{{ .Permalink }}" rel="{{ .Rel }}" title="{{ $.Site.Title }}" type="{{ .MediaType.Type }}">
|
||||
{{ end }}
|
||||
<style>
|
||||
article > div {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
padding: 0.5rem 1rem;
|
||||
border-left: 0.25rem solid #e9ecef;
|
||||
@@ -39,55 +43,35 @@
|
||||
blockquote p:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#content div {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
{{ if templates.Exists "partials/head.html" }}
|
||||
{{ partial "head" . }}
|
||||
{{ partial "head.html" . }}
|
||||
{{ end }}
|
||||
</head>
|
||||
<body class="d-flex flex-column">
|
||||
<div class="container flex-fill">
|
||||
{{ if .Site.Menus.main }}
|
||||
<header>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<nav class="d-flex justify-content-center my-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>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{ if .Site.Menus.main }}
|
||||
<header>
|
||||
{{ partial "paige_menus.html" . }}
|
||||
</header>
|
||||
{{ end }}
|
||||
<main>
|
||||
<article>
|
||||
{{ block "main" . }}{{ end }}
|
||||
</article>
|
||||
</main>
|
||||
{{ if .Site.Copyright }}
|
||||
<footer>
|
||||
<p class="text-center text-muted">{{ .Site.Copyright | markdownify }}</p>
|
||||
</footer>
|
||||
{{ end }}
|
||||
</div>
|
||||
</header>
|
||||
{{ 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>
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
<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 .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-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" onload="renderMathInElement(document.body);" src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js"></script>
|
||||
{{ end }}
|
||||
@@ -95,7 +79,7 @@
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
{{ if templates.Exists "partials/body.html" }}
|
||||
{{ partial "body" . }}
|
||||
{{ partial "body.html" . }}
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,56 +1,47 @@
|
||||
{{ define "main" }}
|
||||
{{ if or .Title .Description }}
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
{{ if .Title }}
|
||||
<h1 class="display-1 fw-bold">{{ .Title | markdownify }}</h1>
|
||||
{{ end }}
|
||||
{{ if .Description }}
|
||||
<p class="lead">{{ .Description | markdownify }}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ if .Title }}
|
||||
<h1 class="display-1 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 .Params.stretch }}
|
||||
<div class="row">
|
||||
<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>
|
||||
<div class="rounded-4 shadow" style="background-image: url('{{ relURL .Params.stretch }}'); background-position: center; background-size: cover; height: 20rem; max-width: 100%"></div>
|
||||
{{ end }}
|
||||
{{ if .Params.center }}
|
||||
<div class="row">
|
||||
<div class="col pb-3 text-center">
|
||||
<img class="rounded-4 shadow" src="{{ relURL .Params.center }}" style="max-height: 20rem; max-width: 100%">
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-center">
|
||||
<img class="rounded-4 shadow" src="{{ relURL .Params.center }}" style="max-height: 20rem; max-width: 100%">
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ if .Params.greeting }}
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<h2 class="display-5 fw-bold">{{ .Params.greeting | markdownify }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="display-5 fw-bold text-center">{{ .Params.greeting | markdownify }}</h2>
|
||||
{{ end }}
|
||||
{{ if .Params.blurb }}
|
||||
<div class="row">
|
||||
<div class="col col-lg-6 mx-auto text-center">
|
||||
<p class="lead">{{ .Params.blurb | markdownify }}</p>
|
||||
<section>
|
||||
<div class="col col-xl-6 mx-auto">
|
||||
<p class="lead text-center">{{ .Params.blurb | markdownify }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ if .Content }}
|
||||
<div class="row">
|
||||
<div class="col">{{ .Content }}</div>
|
||||
</div>
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{ if .Site.Social }}
|
||||
<div class="row">
|
||||
<div class="col pb-3 text-center">
|
||||
<section>
|
||||
<div class="pb-3 text-center">
|
||||
{{ range $k, $v := .Site.Social }}
|
||||
<a href="{{ $v }}"><i class="bi bi-{{ $k }} display-6 px-2"></i></a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@@ -1,70 +1,4 @@
|
||||
{{ define "main" }}
|
||||
<section>
|
||||
{{ if or .Title .Description }}
|
||||
<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>
|
||||
{{ partial "paige_content.html" . }}
|
||||
{{ partial "paige_pages.html" . }}
|
||||
{{ end }}
|
||||
|
@@ -1,40 +1,3 @@
|
||||
{{ define "main" }}
|
||||
{{ if not (or .Title .Description .PublishDate .Content) }}
|
||||
<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 }}
|
||||
{{ partial "paige_content.html" . }}
|
||||
{{ end }}
|
||||
|
@@ -1,40 +1,14 @@
|
||||
{{ define "main" }}
|
||||
{{ if not (or .Title .Pages) }}
|
||||
{{ partial "paige_content.html" . }}
|
||||
{{ if .Pages }}
|
||||
<section>
|
||||
<h1 class="display-5 fw-bold text-center">Nothing Here</h1>
|
||||
</section>
|
||||
{{ else }}
|
||||
<section>
|
||||
{{ if .Title }}
|
||||
<header>
|
||||
<div class="row text-center">
|
||||
<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 }}
|
||||
<ul class="list-inline text-center">
|
||||
{{ range (sort .Pages "Title") }}
|
||||
<li class="list-inline-item">
|
||||
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@@ -1,34 +1,4 @@
|
||||
{{ define "main" }}
|
||||
<section>
|
||||
<header>
|
||||
<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>
|
||||
{{ partial "paige_content.html" . }}
|
||||
{{ partial "paige_pages.html" . }}
|
||||
{{ end }}
|
||||
|
18
layouts/partials/paige_content.html
Normal file
18
layouts/partials/paige_content.html
Normal file
@@ -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 }}
|
15
layouts/partials/paige_menus.html
Normal file
15
layouts/partials/paige_menus.html
Normal file
@@ -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>
|
22
layouts/partials/paige_pages.html
Normal file
22
layouts/partials/paige_pages.html
Normal file
@@ -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 }}
|
Reference in New Issue
Block a user