Add series functionality: update menu, modify post templates, and implement series partials
This commit is contained in:
@@ -15,6 +15,10 @@ main:
|
|||||||
name: "Photos"
|
name: "Photos"
|
||||||
url: "/photos"
|
url: "/photos"
|
||||||
weight: 25
|
weight: 25
|
||||||
|
- pageRef: "/series"
|
||||||
|
name: "Series"
|
||||||
|
url: "/series"
|
||||||
|
weight: 27
|
||||||
- pageRef: "/explore"
|
- pageRef: "/explore"
|
||||||
name: "Explore"
|
name: "Explore"
|
||||||
url: "/explore"
|
url: "/explore"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ description: E ora ho una newsletter
|
|||||||
tags:
|
tags:
|
||||||
- post
|
- post
|
||||||
categories:
|
categories:
|
||||||
- news
|
- rant
|
||||||
reply:
|
reply:
|
||||||
repost:
|
repost:
|
||||||
like:
|
like:
|
||||||
|
|||||||
@@ -41,15 +41,14 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
{{ partial "toc.html" .}}
|
{{ partial "toc.html" .}}
|
||||||
<div class="page-content e-content">
|
<div class="page-content e-content">
|
||||||
{{- partial "bridgy.html" . -}}
|
{{- partial "bridgy.html" . -}}
|
||||||
|
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{ partial "series.html" . }}
|
||||||
{{- partial "syndication.html" . -}}
|
{{- partial "syndication.html" . -}}
|
||||||
{{- partial "comments.html" . -}}
|
{{- partial "comments.html" . -}}
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
{{- partial "bridgy.html" . -}}
|
{{- partial "bridgy.html" . -}}
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{ partial "series.html" . }}
|
||||||
{{- partial "syndication.html" . -}}
|
{{- partial "syndication.html" . -}}
|
||||||
</article>
|
</article>
|
||||||
{{- partial "comments.html" . -}}
|
{{- partial "comments.html" . -}}
|
||||||
|
|||||||
@@ -17,12 +17,6 @@ You mentioned this post on your site? Send a <a href="https://indieweb.org/Webme
|
|||||||
<br>
|
<br>
|
||||||
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
||||||
|
|
||||||
{{- if .Params.series -}}
|
|
||||||
<div class="post-series-bottom">
|
|
||||||
{{ partial "series.html" . }}
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{ with $related }}
|
{{ with $related }}
|
||||||
<h3>See Also</h3>
|
<h3>See Also</h3>
|
||||||
|
|
||||||
|
|||||||
@@ -10,11 +10,10 @@
|
|||||||
{{ else if eq .Type "weeknote" }}
|
{{ else if eq .Type "weeknote" }}
|
||||||
<i class="fa-regular fa-bowl-chopsticks-noodles"></i>
|
<i class="fa-regular fa-bowl-chopsticks-noodles"></i>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<i class="fa-regular fa-cookie-bite"></i>
|
<i class="fa-duotone fa-solid fa-sushi"></i>
|
||||||
{{ end}}
|
{{ end}}
|
||||||
{{ .Title }}</a>
|
{{ .Title }}</a>
|
||||||
</h4>
|
</h4>
|
||||||
<h5>
|
|
||||||
{{/* format date string to create an ISO 8601 string */}}
|
{{/* format date string to create an ISO 8601 string */}}
|
||||||
{{ $ISO_date := "2006-01-02T15:04:05Z0700" }}
|
{{ $ISO_date := "2006-01-02T15:04:05Z0700" }}
|
||||||
{{ $configDateFormat := .Site.Params.dateFormat | default "2 Jan 2006" }}
|
{{ $configDateFormat := .Site.Params.dateFormat | default "2 Jan 2006" }}
|
||||||
@@ -23,8 +22,10 @@
|
|||||||
<i class="fa-regular fa-star"></i>
|
<i class="fa-regular fa-star"></i>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{if not (eq .Type "series") }}
|
||||||
<time class="post-item-meta" datetime="{{ dateFormat $ISO_date .Date }}">
|
<time class="post-item-meta" datetime="{{ dateFormat $ISO_date .Date }}">
|
||||||
{{ time.Format $configDateFormat .Date }}
|
{{ time.Format $configDateFormat .Date }}
|
||||||
{{/* OLD FORMAT: .Date.Format $configDateFormat */}}
|
{{/* OLD FORMAT: .Date.Format $configDateFormat */}}
|
||||||
</time>
|
</time>
|
||||||
|
{{ end}}
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -1,23 +1,28 @@
|
|||||||
{{- with (.GetTerms "series") -}}
|
|
||||||
{{- range . -}}
|
{{- if .Params.series -}}
|
||||||
{{- $series := .Pages.ByDate -}}
|
<div class="post-series-bottom">
|
||||||
<details class="entry-toc">
|
{{- with (.GetTerms "series") -}}
|
||||||
<summary>
|
{{- range . -}}
|
||||||
<span class="entry-toc-header">
|
{{- $series := .Pages.ByDate -}}
|
||||||
This post is part of the <strong>{{ .Title }}</strong> series
|
<details class="entry-toc">
|
||||||
</span>
|
<summary>
|
||||||
</summary>
|
<span class="entry-toc-header">
|
||||||
<ol>
|
This post is part of the <strong>{{ .Title }}</strong> series
|
||||||
{{- range $series -}}
|
</span>
|
||||||
<li>
|
</summary>
|
||||||
{{- if eq .File.UniqueID $.File.UniqueID -}}
|
<ol>
|
||||||
<b>{{ .Title }}</b>
|
{{- range $series -}}
|
||||||
{{- else -}}
|
<li>
|
||||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
{{- if eq .File.UniqueID $.File.UniqueID -}}
|
||||||
{{- end -}}
|
<b>{{ .Title }}</b>
|
||||||
</li>
|
{{- else -}}
|
||||||
{{- end -}}
|
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
</ol>
|
{{- end -}}
|
||||||
</details>
|
</li>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
</ol>
|
||||||
|
</details>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -147,6 +147,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
{{ partial "series.html" . }}
|
||||||
{{- partial "syndication.html" . -}}
|
{{- partial "syndication.html" . -}}
|
||||||
|
|
||||||
{{- partial "comments.html" . -}}
|
{{- partial "comments.html" . -}}
|
||||||
|
|||||||
15
layouts/series/list.html
Normal file
15
layouts/series/list.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{{- define "main" -}}
|
||||||
|
<div class="wrapper list-page">
|
||||||
|
<header class="header">
|
||||||
|
<h1 class="header-title center">{{ .Title }}</h1>
|
||||||
|
</header>
|
||||||
|
<main class="page-content" aria-label="Content">
|
||||||
|
{{ range .Pages.GroupByDate "2006" }}
|
||||||
|
{{/* create a list of posts for each month, with month as heading */}}
|
||||||
|
{{ range $index, $element := .Pages.ByDate }}
|
||||||
|
{{ partial "postCard" . }}
|
||||||
|
{{ end }} {{/* end range .Pages.ByDate */}}
|
||||||
|
{{ end }} {{/* end range .Pages.GroupByDate "2006" */}}
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
Reference in New Issue
Block a user