Compare commits
3 Commits
df22cb2b87
...
a4bff7623d
Author | SHA1 | Date | |
---|---|---|---|
a4bff7623d | |||
b282843b40 | |||
b1d4dd7a32 |
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{{ range .Pages.ByDate.Reverse }}
|
{{ range .Pages.ByDate.Reverse }}
|
||||||
{{ partial "post.html" . }}
|
{{ partial "post.html" (dict "page" .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -33,10 +33,10 @@
|
||||||
{{ $pages := (site.Taxonomies.series.Get .Data.Term).Pages.ByDate.Reverse }}
|
{{ $pages := (site.Taxonomies.series.Get .Data.Term).Pages.ByDate.Reverse }}
|
||||||
<nav id="SeriesNavigation" class="container">
|
<nav id="SeriesNavigation" class="container">
|
||||||
{{ with $pages.Prev page }}
|
{{ with $pages.Prev page }}
|
||||||
{{ partial "serieslink.html" (dict "direction" "previous" "link" .RelPermalink "term" $term "page" .) }}
|
{{ partial "serieslink.html" (dict "direction" "previous" "link" .RelPermalink "page" .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with $pages.Next page }}
|
{{ with $pages.Next page }}
|
||||||
{{ partial "serieslink.html" (dict "direction" "next" "link" .RelPermalink "term" $term "page" .) }}
|
{{ partial "serieslink.html" (dict "direction" "next" "link" .RelPermalink "page" .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</nav>
|
</nav>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{{ range (where (where .Site.Pages.ByDate.Reverse "Section" "blog") ".Kind" "!=" "section") }}
|
{{ range (where (where .Site.Pages.ByDate.Reverse "Section" "blog") ".Kind" "!=" "section") }}
|
||||||
{{ if .Params.favorite }}{{ partial "post.html" . }}{{ end }}
|
{{ if .Params.favorite }}{{ partial "post.html" (dict "page" .) }}{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{{ i18n "recentPosts" }}:
|
{{ i18n "recentPosts" }}:
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{{ range first 10 (where (where .Site.Pages.ByDate.Reverse "Section" "blog") ".Kind" "!=" "section") }}
|
{{ range first 10 (where (where .Site.Pages.ByDate.Reverse "Section" "blog") ".Kind" "!=" "section") }}
|
||||||
{{ partial "post.html" . }}
|
{{ partial "post.html" (dict "page" .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
8
layouts/partials/nameinseries.html
Normal file
8
layouts/partials/nameinseries.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{{- $term := index (.page.GetTerms "series") 0 -}}
|
||||||
|
{{- $divider := $term.Params.divider -}}
|
||||||
|
{{- if (and $divider (strings.Contains .page.Title $divider)) -}}
|
||||||
|
{{- $rest := after 1 (split .page.Title $divider) -}}
|
||||||
|
{{- .scratch.Set "name" (delimit $rest $divider) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .scratch.Set "name" .page.Title -}}
|
||||||
|
{{- end -}}
|
|
@ -1,12 +1,18 @@
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ .Permalink }}" class="post-title">{{ if .Params.favorite }}{{ partial "icon.html" "star" }}{{ end }} {{ .Title }}</a>
|
{{- $scratch := newScratch -}}
|
||||||
{{ if (not (eq .WordCount 0)) }}
|
{{- if .seriesName -}}
|
||||||
<p class="post-wordcount">{{ i18n "nWords" .WordCount }}, {{ i18n "nMinutesToRead" .ReadingTime }}.</p>
|
{{- partial "nameinseries" (dict "page" .page "scratch" $scratch) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $scratch.Set "name" (.page.Title) -}}
|
||||||
|
{{- end -}}
|
||||||
|
<a href="{{ .page.Permalink }}" class="post-title">{{ if .page.Params.favorite }}{{ partial "icon.html" "star" }}{{ end }} {{ $scratch.Get "name" }}</a>
|
||||||
|
{{ if (not (eq .page.WordCount 0)) }}
|
||||||
|
<p class="post-wordcount">{{ i18n "nWords" .page.WordCount }}, {{ i18n "nMinutesToRead" .page.ReadingTime }}.</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .Params.status }}
|
{{ if .page.Params.status }}
|
||||||
<p class="post-status">
|
<p class="post-status">
|
||||||
{{ partial "seriesstatus.html" .Params.status }}
|
{{ partial "seriesstatus.html" .page.Params.status }}
|
||||||
</p>
|
</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<p class="post-preview">{{ .Summary }} {{ if .Truncated }}. . .{{ end }}</p>
|
<p class="post-preview">{{ .page.Summary }} {{ if .page.Truncated }}. . .{{ end }}</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -3,13 +3,9 @@
|
||||||
{{ if eq .direction "previous" }}{{ partial "icon.html" "chevrons-left" }}{{ end }}
|
{{ if eq .direction "previous" }}{{ partial "icon.html" "chevrons-left" }}{{ end }}
|
||||||
<div class="title-subtitle">
|
<div class="title-subtitle">
|
||||||
{{ title .direction }} in Series
|
{{ title .direction }} in Series
|
||||||
{{ $divider := .term.Params.divider }}
|
{{ $scratch := newScratch -}}
|
||||||
{{ if (and $divider (strings.Contains .page.Title $divider)) }}
|
{{- partial "nameinseries.html" (dict "page" .page "scratch" $scratch) -}}
|
||||||
{{ $rest := after 1 (split .page.Title $divider) }}
|
<div class="title">{{ $scratch.Get "name" }}</div>
|
||||||
<div class="title">{{ delimit $rest $divider }}</div>
|
|
||||||
{{ else }}
|
|
||||||
<div class="title">{{ .page.Title }}</div>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
</div>
|
||||||
{{ if eq .direction "next" }}{{ partial "icon.html" "chevrons-right" }}{{ end }}
|
{{ if eq .direction "next" }}{{ partial "icon.html" "chevrons-right" }}{{ end }}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{{ range $pages }}
|
{{ range $pages }}
|
||||||
{{ partial "post.html" . }}
|
{{ partial "post.html" (dict "page" . "seriesName" true) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{{ range sort .Pages "Title" }}
|
{{ range sort .Pages "Title" }}
|
||||||
{{ partial "post.html" . }}
|
{{ partial "post.html" (dict "page" .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{{ range .Pages.ByDate.Reverse }}
|
{{ range .Pages.ByDate.Reverse }}
|
||||||
{{ partial "post.html" . }}
|
{{ partial "post.html" (dict "page" .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user