From b21933aa4c8fcedc94db1719cb265870151fb885 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Sun, 16 Aug 2020 09:28:47 +0300 Subject: Squashed 'website/themes/base16/' changes from 7b2da73..861b48a 861b48a Fix homepage for Hugo v0.57.0+ 785529b Merge pull request #22 from htdvisser/dependabot/npm_and_yarn/lodash.template-4.5.0 eebef6d Bump lodash.template from 4.4.0 to 4.5.0 004fb6d Merge pull request #19 from htdvisser/dependabot/npm_and_yarn/js-yaml-3.13.1 e481251 "Urlize" Tags and Categories in Article and swap ".Hugo" for "hugo" (#20) cdc4ae0 Humanize link text for Categories to handle spaces 72fdc0d Urlize tags and categories in article.html 623ee7c Swap deprecated '.Hugo' for 'hugo' be36348 Bump js-yaml from 3.13.0 to 3.13.1 08da946 Fix rendering of page title 62034ea Update dependencies, rebuild and bump version 12c8463 Merge pull request #18 from denislobanov/pagination bc4166b Move paginator to partial and add to other lists 8fde45b static css 75a3a83 Add support for Pagination #2 git-subtree-dir: website/themes/base16 git-subtree-split: 861b48ad0ff31e9b2bee50f2a87925820daac9f5 --- layouts/partials/article.html | 4 ++-- layouts/partials/header.html | 4 ++-- layouts/partials/homepage.html | 7 +++++-- layouts/partials/paginator.html | 17 +++++++++++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/paginator.html (limited to 'layouts/partials') diff --git a/layouts/partials/article.html b/layouts/partials/article.html index c69a76f..a1da41b 100644 --- a/layouts/partials/article.html +++ b/layouts/partials/article.html @@ -9,7 +9,7 @@ {{ if $page.Date.IsZero }}published {{ end }}in {{ range . }} - {{ . }} + {{ . }} {{ end }} {{ end }} @@ -18,7 +18,7 @@ tags: {{ range . }} - {{ . }} + {{ . }} {{ end }} {{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 715808c..c847d77 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -9,12 +9,12 @@ {{- with $.Param "author" }} {{- end }} -{{ .Hugo.Generator }} +{{ hugo.Generator }} -{{ $isHomePage := eq .Title .Site.Title }}{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }} +{{ with .Title }}{{.}} - {{ end }}{{ .Site.Title }} diff --git a/layouts/partials/homepage.html b/layouts/partials/homepage.html index cdbc78e..2dcfec7 100644 --- a/layouts/partials/homepage.html +++ b/layouts/partials/homepage.html @@ -5,12 +5,15 @@

Recent Posts

+ {{ $paginator := .Paginate (where .Site.RegularPages "Section" "post") (or .Site.Params.paginate 3) }}
- {{ range first 3 (where .Data.Pages "Section" "post") }} + {{ range $paginator.Pages }} {{ partial "article-list-item.html" . }} {{ end }}
+ {{ partial "paginator.html" $paginator }} + {{ with .Site.Taxonomies.categories }}

Categories

@@ -18,7 +21,7 @@
{{ range $name, $value := . }}

- {{ title $name }} + {{ humanize $name | title }} ({{ .Count }})

{{ end }} diff --git a/layouts/partials/paginator.html b/layouts/partials/paginator.html new file mode 100644 index 0000000..67cdfe4 --- /dev/null +++ b/layouts/partials/paginator.html @@ -0,0 +1,17 @@ +{{ if gt .TotalPages 1 }} + +{{ end }} -- cgit v1.3.1-26-gb76a