mirror of
https://github.com/maikka39/Personal-Website.git
synced 2026-10-24 06:56:59 +00:00
Fix pagination on writeups
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
{{- $paginator := .Paginate .RegularPagesRecursive }}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ .Site.Language }}">
|
<html lang="{{ .Site.Language }}">
|
||||||
|
|
||||||
|
|||||||
@@ -210,16 +210,15 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
"description": {{ .Params.description | plainify }}
|
"description": {{ .Params.description | plainify }}
|
||||||
}{{ end }}{{ if .IsSection }},
|
}{{ end }}{{ if or .IsSection (or (eq .Kind "term") (eq .Kind "taxonomy")) }},
|
||||||
{
|
{
|
||||||
"@context": "http://schema.org",
|
"@context": "http://schema.org",
|
||||||
"@type": "ItemList",
|
"@type": "ItemList",
|
||||||
"itemListOrder": "https://schema.org/ItemListOrderDescending",
|
"itemListOrder": "https://schema.org/ItemListOrderDescending",
|
||||||
"name": "{{ .Title }}",
|
"name": "{{ .Title }}",
|
||||||
"numberOfItems": {{ len .Data.Pages }},
|
"numberOfItems": {{ .Paginator.TotalNumberOfElements }},
|
||||||
"itemListElement": [
|
"itemListElement": [
|
||||||
{{- $pages := first 10 .Data.Pages }}
|
{{- range $index, $page := .Paginator.Pages }}
|
||||||
{{- range $index, $page := $pages }}
|
|
||||||
{
|
{
|
||||||
"@type": "ListItem",
|
"@type": "ListItem",
|
||||||
"position": {{ add $index 1 }},
|
"position": {{ add $index 1 }},
|
||||||
@@ -283,7 +282,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
"description": {{ .Params.description | plainify }}
|
"description": {{ .Params.description | plainify }}
|
||||||
}
|
}
|
||||||
}{{ if ne (sub (len $pages) 1) $index }},{{ end }}
|
}{{ if ne $index (sub $.Paginator.NumberOfElements 1) }},{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
]
|
]
|
||||||
}{{ end }}
|
}{{ end }}
|
||||||
|
|||||||
@@ -1,14 +1,5 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
||||||
{{- $allWriteups := slice }}
|
|
||||||
{{- range where (where .Site.Pages "Section" .Section) "IsPage" true }}
|
|
||||||
{{- if $.IsAncestor . }}
|
|
||||||
{{- $allWriteups = $allWriteups | append . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- $allWriteups = sort $allWriteups "Date" "desc" }}
|
|
||||||
{{ $paginator := .Paginate $allWriteups }}
|
|
||||||
|
|
||||||
<main class="posts">
|
<main class="posts">
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
|
|
||||||
@@ -21,7 +12,7 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
<div class="posts-list masonry">
|
<div class="posts-list masonry">
|
||||||
{{ range $paginator.Pages }}
|
{{ range .Paginator.Pages }}
|
||||||
<div class="post masonry-item">
|
<div class="post masonry-item">
|
||||||
<div class="masonry-item-content">
|
<div class="masonry-item-content">
|
||||||
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
|
||||||
|
|||||||
Reference in New Issue
Block a user