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 "series.html" . }}
{{ partial "share-buttons" . }} {{ partial "share-buttons" . }}
{{ partial "cite" . }}
{{- partial "syndication.html" . -}} {{- partial "syndication.html" . -}}
{{- partial "comments.html" . -}} {{- partial "comments.html" . -}}
</article> </article>

View File

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

View File

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

View File

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

View File

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

View File

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