Add citation and share buttons to various layouts

This commit is contained in:
Fundor333
2026-01-12 01:04:36 +01:00
parent 7ba96ff849
commit 45f0f20b1a
6 changed files with 185 additions and 180 deletions

View File

@@ -47,6 +47,7 @@
{{ partial "series.html" . }}
{{ partial "share-buttons" . }}
{{ partial "cite" . }}
{{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}}
</article>

View File

@@ -1,39 +1,40 @@
{{ define "main" }}
<div class="wrapper post">
<main class="page-content" aria-label="Content">
<article class="h-entry">
<header class="header">
<h1 class="header-title p-name">{{ .Title }}</h1>
<main class="page-content" aria-label="Content">
<article class="h-entry">
<header class="header">
<h1 class="header-title p-name">{{ .Title }}</h1>
<div class="post-meta">
<div style="display: none;" class="p-summary ">{{ .Description }}</div>
<div class="post-meta">
<div style="display: none;" class="p-summary ">{{ .Description }}</div>
<i class="fa-regular fa-typewriter"></i> {{.Site.Params.Author.name }} |
{{ $configDateFormat := .Site.Params.dateFormat | default ":date_medium" }}
{{ with .Date }}
{{ $ISO_time := dateFormat "2006-01-02T15:04:05-07:00" . }}
<i class="fa-regular fa-calendar-range"></i>
<time datetime="{{ $ISO_time }}" class="dt-published" itemprop="datePublished">
{{ . | time.Format $configDateFormat }}
</time>
{{ end }}
{{- partial "tags.html" . -}}
<i class="fa-regular fa-typewriter"></i> {{.Site.Params.Author.name }} |
{{ $configDateFormat := .Site.Params.dateFormat | default ":date_medium" }}
{{ with .Date }}
{{ $ISO_time := dateFormat "2006-01-02T15:04:05-07:00" . }}
<i class="fa-regular fa-calendar-range"></i>
<time datetime="{{ $ISO_time }}" class="dt-published" itemprop="datePublished">
{{ . | time.Format $configDateFormat }}
</time>
{{ end }}
{{- partial "tags.html" . -}}
</div>
</header>
{{ partial "toc.html" .}}
<hr>
</div>
</header>
{{ partial "toc.html" .}}
<hr>
<div class="page-content e-content">
{{ partial "micro.html" . }}
{{- partial "bridgy.html" . -}}
{{ .Content }}
</div>
{{ partial "series.html" . }}
{{- partial "syndication.html" . -}}
</article>
{{- partial "comments.html" . -}}
</main>
<div class="page-content e-content">
{{ partial "micro.html" . }}
{{- partial "bridgy.html" . -}}
{{ .Content }}
</div>
{{ partial "share-buttons" . }}
{{ partial "cite" . }}
{{ partial "series.html" . }}
{{- partial "syndication.html" . -}}
</article>
{{- partial "comments.html" . -}}
</main>
</div>
{{ end }}

View File

@@ -13,6 +13,8 @@
<div class="page-content e-content typewriter">
{{ .Content }}
</div>
{{ partial "share-buttons" . }}
{{ partial "cite" . }}
{{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}}
</article>

View File

@@ -5,8 +5,7 @@
<p>
<a href="https://fundor333.com/cite">Learn more</a>
</p>
<label>URL for this post: <input disabled style="cursor: text;" type="text" value="{{ .Page.Permalink }}" id="citeInput">
<button onclick="myFunction()">Copy text</button>
<label>URL for this post: <input onclick="myFunction()" disabled style="cursor: text;" type="text" value="{{ .Page.Permalink }}" id="citeInput">
</label>
</details>

View File

@@ -2,163 +2,163 @@
<!--Implementation from https://billglover.me/2023/11/07/creating-a-photography-gallery-with-hugo/ -->
<div class="wrapper post">
<main class="page-content" aria-label="Content">
<article class="h-entry">
{{- partial "bridgy.html" . -}}
<header class="header">
<h1 class="header-title p-name">{{ .Title }}</h1>
<main class="page-content" aria-label="Content">
<article class="h-entry">
{{- partial "bridgy.html" . -}}
<header class="header">
<h1 class="header-title p-name">{{ .Title }}</h1>
<i class="fa-regular fa-typewriter"></i> {{.Site.Params.Author.name }} |
{{ $configDateFormat := .Site.Params.dateFormat | default ":date_medium" }}
{{ with .Date }}
{{ $ISO_time := dateFormat "2006-01-02T15:04:05-07:00" . }}
<i class="fa-regular fa-calendar-range"></i>
<time datetime="{{ $ISO_time }}" class="dt-published" itemprop="datePublished">
{{ . | time.Format $configDateFormat }}
</time>
{{ end }}
{{ partial "tags.html" . }}
<i class="fa-regular fa-typewriter"></i> {{.Site.Params.Author.name }} |
{{ $configDateFormat := .Site.Params.dateFormat | default ":date_medium" }}
{{ with .Date }}
{{ $ISO_time := dateFormat "2006-01-02T15:04:05-07:00" . }}
<i class="fa-regular fa-calendar-range"></i>
<time datetime="{{ $ISO_time }}" class="dt-published" itemprop="datePublished">
{{ . | time.Format $configDateFormat }}
</time>
{{ end }}
{{ partial "tags.html" . }}
{{ partial "toc.html" .}}
<div class="page-content e-content">
{{ with .Resources.ByType "image" }}
{{ partial "toc.html" .}}
<div class="page-content e-content">
{{ with .Resources.ByType "image" }}
{{ range . }}
{{ $image := . }}
{{ if $image }}
<div class="container-fluid text-justify">
{{ $resource := imageConfig (add "/content/" $image.RelPermalink) }}
{{ range . }}
{{ $image := . }}
{{ if $image }}
<div class="container-fluid text-justify">
{{ $resource := imageConfig (add "/content/" $image.RelPermalink) }}
<div class="flex flex-col items-stretch">
<figure class="figure hmedia">
<img loading="lazy" class="u-photo rounded-lg figure-img img-fluid" src="{{ $image.Permalink }}"alt="{{ $.Description }}">
{{if .Params.feature_link}}
<figcaption class="figure-caption">{{ $.Description }}</figcaption>
</figure>
<a class="self-center" href="{{ .Params.feature_link}}">{{.Params.feature_text}}</a>
{{end}}
</div>
{{end}}
<div class="flex flex-col items-stretch">
<figure class="figure hmedia">
<img loading="lazy" class="u-photo rounded-lg figure-img img-fluid" src="{{ $image.Permalink }}" alt="{{ $.Description }}">
{{if .Params.feature_link}}
<figcaption class="figure-caption">{{ $.Description }}</figcaption>
</figure>
<a class="self-center" href="{{ .Params.feature_link}}">{{.Params.feature_text}}</a>
{{end}}
</div>
{{end}}
{{ with .Exif }}
<table>
{{ with $image.Title }}
<tr>
<th scope="col">Title</th>
<td>{{ . }}</td>
</tr>
{{ end }}
{{ with .Date }}
<tr>
<th scope="col">Date</th>
<td>{{ . }}</td>
</tr>
{{ end }}
{{ if isset .Tags "Model" }}
<tr>
<th>Camera</th>
<td>{{ .Tags.Model }}</td>
</tr>
{{ end }}
{{ if isset .Tags "LensModel" }}
<tr>
<th>Lens</th>
<td>{{ .Tags.LensModel }}</td>
</tr>
{{ end }}
{{ if isset .Tags "ExposureTime" }}
<tr>
<th>Exposure Time</th>
<td>{{ .Tags.ExposureTime }}</td>
</tr>
{{ end }}
{{ if isset .Tags "FNumber" }}
<tr>
<th>F Number</th>
<td>{{ .Tags.FNumber }}</td>
</tr>
{{ end }}
{{ if isset .Tags "ISOSpeedRatings" }}
<tr>
<th>ISO</th>
<td>{{ .Tags.ISOSpeedRatings }}</td>
</tr>
{{ end }}
{{ if isset .Tags "FocalLength" }}
<tr>
<th>Focal Length</th>
<td>{{ .Tags.FocalLength }}</td>
</tr>
{{ end }}
{{ if isset .Tags "ExposureMode" }}
<tr>
<th>Exposure Mode</th>
<td>
{{ with (eq .Tags.ExposureMode 1) }}Manual{{ end }}
{{ with (eq .Tags.ExposureMode 0) }}Auto{{ end }}
</td>
</tr>
{{ end }}
{{ if isset .Tags "ExposureProgram" }}
<tr>
<th>Exposure Program</th>
<td>
{{ with (eq .Tags.WhiteBalance 1) }}Manual{{ end }}
{{ with (eq .Tags.WhiteBalance 0) }}Auto{{ end }}
</td>
</tr>
{{ end }}
{{ with .Tags.ExposureBiasValue }}
<tr>
<th>Exposure Compensation</th>
<td>{{ . }}</td>
</tr>
{{ end }}
{{ if isset .Tags "WhiteBalance" }}
<tr>
<th>White Balance</th>
<td>
{{ with (eq .Tags.WhiteBalance 1) }}Manual{{ end }}
{{ with (eq .Tags.WhiteBalance 0) }}Auto{{ end }}
</td>
</tr>
{{ end }}
{{ if isset .Tags "MeteringMode" }}
<tr>
<th>Metering Mode</th>
<td>
{{ with (eq .Tags.MeteringMode 0) }}Unknown{{ end }}
{{ with (eq .Tags.MeteringMode 1) }}Average{{ end }}
{{ with (eq .Tags.MeteringMode 2) }}Center Weighted Average{{ end }}
{{ with (eq .Tags.MeteringMode 3) }}Spot{{ end }}
{{ with (eq .Tags.MeteringMode 4) }}MultiSpot{{ end }}
{{ with (eq .Tags.MeteringMode 5) }}Pattern{{ end }}
{{ with (eq .Tags.MeteringMode 6) }}Partial{{ end }}
{{ with (eq .Tags.MeteringMode 255) }}other{{ end }}
</td>
</tr>
{{ end }}
</table>
<hr>
<br>
{{ end }}
{{ end }}
{{ with .Exif }}
<table>
{{ with $image.Title }}
<tr>
<th scope="col">Title</th>
<td>{{ . }}</td>
</tr>
{{ end }}
{{ with .Date }}
<tr>
<th scope="col">Date</th>
<td>{{ . }}</td>
</tr>
{{ end }}
{{ if isset .Tags "Model" }}
<tr>
<th>Camera</th>
<td>{{ .Tags.Model }}</td>
</tr>
{{ end }}
{{ if isset .Tags "LensModel" }}
<tr>
<th>Lens</th>
<td>{{ .Tags.LensModel }}</td>
</tr>
{{ end }}
{{ if isset .Tags "ExposureTime" }}
<tr>
<th>Exposure Time</th>
<td>{{ .Tags.ExposureTime }}</td>
</tr>
{{ end }}
{{ if isset .Tags "FNumber" }}
<tr>
<th>F Number</th>
<td>{{ .Tags.FNumber }}</td>
</tr>
{{ end }}
{{ if isset .Tags "ISOSpeedRatings" }}
<tr>
<th>ISO</th>
<td>{{ .Tags.ISOSpeedRatings }}</td>
</tr>
{{ end }}
{{ if isset .Tags "FocalLength" }}
<tr>
<th>Focal Length</th>
<td>{{ .Tags.FocalLength }}</td>
</tr>
{{ end }}
{{ if isset .Tags "ExposureMode" }}
<tr>
<th>Exposure Mode</th>
<td>
{{ with (eq .Tags.ExposureMode 1) }}Manual{{ end }}
{{ with (eq .Tags.ExposureMode 0) }}Auto{{ end }}
</td>
</tr>
{{ end }}
{{ if isset .Tags "ExposureProgram" }}
<tr>
<th>Exposure Program</th>
<td>
{{ with (eq .Tags.WhiteBalance 1) }}Manual{{ end }}
{{ with (eq .Tags.WhiteBalance 0) }}Auto{{ end }}
</td>
</tr>
{{ end }}
{{ with .Tags.ExposureBiasValue }}
<tr>
<th>Exposure Compensation</th>
<td>{{ . }}</td>
</tr>
{{ end }}
{{ if isset .Tags "WhiteBalance" }}
<tr>
<th>White Balance</th>
<td>
{{ with (eq .Tags.WhiteBalance 1) }}Manual{{ end }}
{{ with (eq .Tags.WhiteBalance 0) }}Auto{{ end }}
</td>
</tr>
{{ end }}
{{ if isset .Tags "MeteringMode" }}
<tr>
<th>Metering Mode</th>
<td>
{{ with (eq .Tags.MeteringMode 0) }}Unknown{{ end }}
{{ with (eq .Tags.MeteringMode 1) }}Average{{ end }}
{{ with (eq .Tags.MeteringMode 2) }}Center Weighted Average{{ end }}
{{ with (eq .Tags.MeteringMode 3) }}Spot{{ end }}
{{ with (eq .Tags.MeteringMode 4) }}MultiSpot{{ end }}
{{ with (eq .Tags.MeteringMode 5) }}Pattern{{ end }}
{{ with (eq .Tags.MeteringMode 6) }}Partial{{ end }}
{{ with (eq .Tags.MeteringMode 255) }}other{{ end }}
</td>
</tr>
{{ end }}
</table>
<hr>
<br>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
<div class="grid grid-cols-1 justify-items-start">
{{- partial "bridgy.html" . -}}
{{- .Content }}
</div>
<div class="grid grid-cols-1 justify-items-start">
{{- partial "bridgy.html" . -}}
{{- .Content }}
</div>
</div>
</div>
</article>
{{ partial "share-buttons" . }}
{{ partial "cite" . }}
{{ partial "series.html" . }}
{{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}}
</main>
</div>
{{ end }}
</main>
</div>
{{ end }}

View File

@@ -27,6 +27,8 @@
<div class="page-content e-content weeknote">
{{ .Content }}
</div>
{{ partial "share-buttons" . }}
{{ partial "cite" . }}
{{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}}
</article>