Use with where possible
This commit is contained in:
@@ -2,21 +2,21 @@
|
||||
{{ partial "paige-title.html" . }}
|
||||
{{ partial "paige-description.html" . }}
|
||||
{{ partial "paige-date.html" . }}
|
||||
{{ if .Params.stretch }}
|
||||
<div class="rounded-4 shadow" style="background-image: url('{{ relURL .Params.stretch }}'); background-position: center; background-size: cover; height: 20rem; max-width: 100%"></div>
|
||||
{{ with .Params.stretch }}
|
||||
<div class="rounded-4 shadow" style="background-image: url('{{ relURL . }}'); background-position: center; background-size: cover; height: 20rem; max-width: 100%"></div>
|
||||
{{ end }}
|
||||
{{ if .Params.center }}
|
||||
{{ with .Params.center }}
|
||||
<p class="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 . }}" style="max-height: 20rem; max-width: 100%">
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ if .Params.greeting }}
|
||||
<h2 class="display-5 fw-bold text-center">{{ .Params.greeting | markdownify }}</h2>
|
||||
{{ with .Params.greeting }}
|
||||
<h2 class="display-5 fw-bold text-center">{{ . | markdownify }}</h2>
|
||||
{{ end }}
|
||||
{{ if .Params.blurb }}
|
||||
{{ with .Params.blurb }}
|
||||
<section>
|
||||
<div class="col col-lg-7 mx-auto">
|
||||
<p class="lead text-center">{{ .Params.blurb | markdownify }}</p>
|
||||
<p class="lead text-center">{{ . | markdownify }}</p>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
@@ -1,3 +1,3 @@
|
||||
{{ if .Content }}
|
||||
{{ .Content | replaceRE `(<h[1-9] id="([^"]+)".+)(</h[1-9]+>)` `${1}<a class="headerlink" href="#${2}"><i class="bi bi-link-45deg small"></i></a>${3}` | safeHTML }}
|
||||
{{ with .Content }}
|
||||
{{ . | replaceRE `(<h[1-9] id="([^"]+)".+)(</h[1-9]+>)` `${1}<a class="headerlink" href="#${2}"><i class="bi bi-link-45deg small"></i></a>${3}` | safeHTML }}
|
||||
{{ end }}
|
||||
|
@@ -1,3 +1,3 @@
|
||||
{{ if .PublishDate }}
|
||||
<p class="text-center text-muted"><time datetime="{{ .PublishDate.Format `2006-01-02` }}">{{ .PublishDate.Format "January 2, 2006" }}</time></p>
|
||||
{{ with .PublishDate }}
|
||||
<p class="text-center text-muted"><time datetime="{{ .Format `2006-01-02` }}">{{ .Format "January 2, 2006" }}</time></p>
|
||||
{{ end }}
|
||||
|
@@ -1,3 +1,3 @@
|
||||
{{ if .Description }}
|
||||
<p class="lead text-center">{{ .Description | markdownify }}</p>
|
||||
{{ with .Description }}
|
||||
<p class="lead text-center">{{ . | markdownify }}</p>
|
||||
{{ end }}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
{{ if .Site.Params.paigebootstrapcss }}
|
||||
<link href="{{ relURL .Site.Params.paigebootstrapcss }}" rel="stylesheet">
|
||||
{{ with .Site.Params.paigebootstrapcss }}
|
||||
<link href="{{ relURL . }}" rel="stylesheet">
|
||||
{{ else }}
|
||||
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" rel="stylesheet">
|
||||
{{ end }}
|
||||
{{ if .Site.Params.paigebootstrapicons }}
|
||||
<link href="{{ relURL .Site.Params.paigebootstrapicons }}" rel="stylesheet">
|
||||
{{ with .Site.Params.paigebootstrapicons }}
|
||||
<link href="{{ relURL . }}" rel="stylesheet">
|
||||
{{ else }}
|
||||
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.2/font/bootstrap-icons.css" integrity="sha384-b6lVK+yci+bfDmaY1u0zE8YYJt0TZxLEAFyYSLHId4xoVvsrQu3INevFKo+Xir8e" rel="stylesheet">
|
||||
{{ end }}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<meta charset="utf-8">
|
||||
{{ if .Site.Author.name }}
|
||||
<meta content="{{ .Site.Author.name }}" name="author">
|
||||
{{ with .Site.Author.name }}
|
||||
<meta content="{{ . }}" name="author">
|
||||
{{ end }}
|
||||
{{ if .Description }}
|
||||
<meta content="{{ .Description }}" name="description">
|
||||
{{ with .Description }}
|
||||
<meta content="{{ . }}" name="description">
|
||||
{{ end }}
|
||||
{{ if or .Keywords .Params.tags .Params.categories }}
|
||||
<meta content="{{ delimit (sort (union (union .Keywords .Params.tags) .Params.categories)) `, ` }}" name="keywords">
|
||||
|
@@ -6,15 +6,15 @@
|
||||
{{ range .Pages }}
|
||||
<p class="text-center">
|
||||
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
|
||||
{{ if .Description }}
|
||||
{{ with .Description }}
|
||||
<br>
|
||||
{{ .Description | markdownify }}
|
||||
{{ . | markdownify }}
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if or $p.HasPrev $p.HasNext }}
|
||||
<div class="d-flex justify-content-center pt-3">
|
||||
<div class="d-flex justify-content-center">
|
||||
{{ partial "paige-pagination.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{{ if .Site.Params.paigebootstrapjs }}
|
||||
<script defer src="{{ relURL .Site.Params.paigebootstrapjs }}"></script>
|
||||
{{ with .Site.Params.paigebootstrapjs }}
|
||||
<script defer src="{{ relURL . }}"></script>
|
||||
{{ else }}
|
||||
<script crossorigin="anonymous" defer integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" referrerpolicy="no-referrer" src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
{{ end }}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{{ if .Site.Social }}
|
||||
{{ with .Site.Social }}
|
||||
<section>
|
||||
<div class="pb-3 text-center">
|
||||
{{ range $k, $v := .Site.Social }}
|
||||
{{ range $k, $v := . }}
|
||||
<a href="{{ $v }}"><i class="bi bi-{{ $k }} display-6 px-2"></i></a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@@ -8,8 +8,8 @@
|
||||
{{ end }}
|
||||
{{ if $title }}
|
||||
<h1 class="{{ $class }} fw-bold text-center">
|
||||
{{ if .Params.link }}
|
||||
<a href="{{ .Params.link }}">{{ $title | markdownify }}</a>
|
||||
{{ with .Params.link }}
|
||||
<a href="{{ . }}">{{ $title | markdownify }}</a>
|
||||
{{ else }}
|
||||
{{ $title | markdownify }}
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user