Merge branch 'master' into scroll-spy
This commit is contained in:
@ -1,36 +0,0 @@
|
||||
{{ $image := "" -}}
|
||||
{{ if (urls.Parse .Destination).IsAbs }}
|
||||
{{ $image = resources.GetRemote .Destination -}}
|
||||
{{ else -}}
|
||||
{{ $image = .Page.Resources.GetMatch .Destination -}}
|
||||
{{ end -}}
|
||||
{{ with $image -}}
|
||||
{{ $lqip := $image.Resize site.Params.lqipWidth -}}
|
||||
|
||||
{{ $imgSrc := "" -}}
|
||||
{{ $imgSrcSet := slice -}}
|
||||
|
||||
{{ $widths := site.Params.landscapePhotoWidths -}}
|
||||
{{ if gt $image.Height $image.Width -}}
|
||||
{{ $widths = site.Params.portraitPhotoWidths -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ range $widths -}}
|
||||
{{ $srcUrl := (printf "%dx" . | $image.Resize).Permalink -}}
|
||||
{{ if eq $imgSrc "" -}}{{ $imgSrc = $srcUrl -}}{{ end -}}
|
||||
{{ $imgSrcSet = $imgSrcSet | append (printf "%s %dw" $srcUrl .) -}}
|
||||
{{ end -}}
|
||||
{{ $imgSrcSet = (delimit $imgSrcSet ",") -}}
|
||||
|
||||
{{ if gt $image.Width site.Params.smallLimit -}}
|
||||
<figure class="figure">
|
||||
<img class="figure-img img-fluid lazyload blur-up" data-sizes="auto" src="{{ $lqip.Permalink }}" data-srcset="{{ $imgSrcSet }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ $.Text }}">
|
||||
<noscript><img class="figure-img img-fluid" sizes="100vw" srcset="{{ $imgSrcSet }}" src="{{ $image.Permalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ $.Text }}"></noscript>
|
||||
{{ with $.Title }}<figcaption class="figure-caption">{{ . | safeHTML }}</figcaption>{{ end -}}
|
||||
</figure>
|
||||
{{ else -}}
|
||||
<img class="img-fluid lazyload blur-up" src="{{ $lqip.Permalink }}" data-src="{{ $image.Permalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ $.Text }}">
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ erroridf "image-not-found" "Image not found" -}}
|
||||
{{ end -}}
|
@ -23,5 +23,10 @@
|
||||
{{ block "sidebar-footer" . }}{{ end }}
|
||||
{{ partial "footer/footer.html" . }}
|
||||
{{ partial "footer/script-footer.html" . }}
|
||||
{{ if eq .Site.Params.options.toTopButton true -}}
|
||||
<div class="d-flex fixed-bottom pb-4 pb-lg-5 pe-4 pe-lg-5">
|
||||
<a id="toTop" href="#" class="btn btn-outline-primary rounded-circle ms-auto p-2"><span class="visually-hidden">Top</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-up"><polyline points="18 15 12 9 6 15"></polyline></svg></a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
@ -1,13 +1,32 @@
|
||||
{{ define "main" }}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12 col-lg-10 col-xl-8">
|
||||
{{ range .Paginator.Pages }}
|
||||
<article>
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
||||
{{ .Description }}
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
<div class="col-md-12 col-lg-9">
|
||||
<h1 class="text-center">{{ .Title }}</h1>
|
||||
{{ with .Content -}}<div class="text-center">{{ . }}</div>{{ end -}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row row-cols-1 row-cols-lg-2 g-lg-5">
|
||||
{{ $paginator := .Paginate (.Data.Pages) -}}
|
||||
{{ range $paginator.Pages -}}
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
{{- .Scratch.Set "fillImage" "1270x620 Center" -}}
|
||||
{{ partial "content/card-image.html" . }}
|
||||
<div class="card-body">
|
||||
<article>
|
||||
<h2 class="h3"><a class="stretched-link text-body" href="{{ .RelPermalink }}">{{ .Params.title }}</a></h2>
|
||||
<p>{{ .Params.excerpt | safeHTML }}</p>
|
||||
{{ partial "main/blog-meta.html" . -}}
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end -}}
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12 col-lg-9">
|
||||
{{ $.Scratch.Set "paginator" true }}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
20
layouts/_default/terms.html
Normal file
20
layouts/_default/terms.html
Normal file
@ -0,0 +1,20 @@
|
||||
{{ define "main" }}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12 col-lg-10 col-xl-8">
|
||||
<h1 class="text-center">{{ .Title }}</h1>
|
||||
<div class="text-center">{{ .Content }}</div>
|
||||
<div class="card-list">
|
||||
{{ range .Paginator.Pages }}
|
||||
<div class="card card-terms my-3">
|
||||
<div class="card-body">
|
||||
<article>
|
||||
<a class="stretched-link" href="{{ .RelPermalink }}">{{ .Params.title | title }} →</a>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
Reference in New Issue
Block a user