Skip to content

Commit

Permalink
fix: twitter_simple shortcode, paginator issue since hugo v0.123.0 (#…
Browse files Browse the repository at this point in the history
…170)

* fix: twitter_simple shortcode, closes #171
* bump HUGO_VERSION to 0.123.7 in netlify.toml
* fix paginator issue since hugo v0.123.0

Pages of kind "page" don't allow the creation of a paginator (.Paginate
or .Paginator) in the newest version of hugo.
Pages of kind "section" (e.g. /posts) still allow the creation. This fix
adds a check for the kind of page and excludes pages with kind "page"
from creating a paginator.


---------

Co-authored-by: Sidharth R <122173059+hugo-sid@users.noreply.github.com>
  • Loading branch information
MichielVanDerWinden and hugo-sid authored Mar 7, 2024
1 parent 0ca8845 commit 9f042a8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion exampleSite/content/de/posts/rich-content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme

## Twitter Simple Shortcode

{{< twitter_simple DesignReviewed 1085870671291310081 >}}
{{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}}

<br>

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/en/posts/rich-content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme

## Twitter Simple Shortcode

{{< twitter_simple DesignReviewed 1085870671291310081 >}}
{{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}}

<br>

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/it/posts/rich-content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Hugo viene distribuito con alcuni [Shortcode integrati](https://gohugo.io/conten

## Semplice Shortcode Per Twitter

{{< twitter_simple DesignReviewed 1085870671291310081 >}}
{{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}}

<br>

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/ru/posts/rich-content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Hugo поставляется с несколькими [встроенными

## Простой шорт код для Twitter

{{< twitter_simple DesignReviewed 1085870671291310081 >}}
{{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}}

<br>

Expand Down
2 changes: 2 additions & 0 deletions layouts/partials/meta/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{{ if eq .Section "posts" }}
{{ $ISO_date := dateFormat "2006-01-02T15:04:05Z0700" .Date | safeHTML }}
<!-- Pagination meta tags for list pages only -->
{{ if ne .Page.Kind "page" }}
{{ $paginator := .Paginate (where .Pages "Section" "blog") }}
{{ if $paginator }}
<link rel="first" href="{{ $paginator.First.URL }}" />
Expand All @@ -13,6 +14,7 @@
<link rel="next" href="{{ $paginator.Next.URL }}" />
{{end }}
{{end }}
{{end }}

<meta property="og:type" content="article" />
<meta property="og:article:published_time" content={{ $ISO_date | safeHTML }} />
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
command = "cd exampleSite && hugo --gc --themesDir ../.."

[build.environment]
HUGO_VERSION = "0.122.0"
HUGO_VERSION = "0.123.7"
HUGO_THEME = "repo"

# Deploy Preview context: all deploys generated from
Expand Down

0 comments on commit 9f042a8

Please sign in to comment.