Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination bar is duplicated in term page #366

Closed
younsl opened this issue Nov 13, 2022 · 1 comment
Closed

Pagination bar is duplicated in term page #366

younsl opened this issue Nov 13, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@younsl
Copy link
Contributor

younsl commented Nov 13, 2022

What happened?

Syptom

Pagination bar is duplicated in term page.
This bug appeared after upgrading from congo v2.3.1 to v2.4.0.

image

Workaround

To solve this bug, I found a simple workaround.
But I don't know if this is a good way. (just take note)

layouts/_default/term.html

{{ define "main" }}
  <header>
    {{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
      {{ partial "breadcrumbs.html" . }}
    {{ end }}
    <h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
  </header>
  {{ if .Content }}
    <section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
      <div class="min-w-0 min-h-0 max-w-prose grow">
        {{ .Content | emojify }}
      </div>
    </section>
  {{ end }}
  <section>
    {{ if .Data.Pages }}
      <section>
        {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }}
          {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
            <h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
              {{ .Key }}
            </h2>
            <hr class="border-dotted w-36 border-neutral-400" />
            {{ range .Pages }}
              {{ partial "article-link.html" . }}
            {{ end }}
          {{ end }}
        {{ else }}
          {{ range .Paginator.Pages }}
            {{ partial "article-link.html" . }}
          {{ end }}
        {{ end }}
      </section>
      {{ partial "pagination.html" . }}
    {{ else }}
      <section class="mt-10 prose dark:prose-invert">
        <p class="py-8 border-t">
          <em>{{ i18n "list.no_articles" | emojify }}</em>
        </p>
      </section>
    {{ end }}
  </section>
- {{ partial "pagination.html" . }}
{{ end }}

And then, the pagination bar works normally on the term page.

image

Reference

Fix error calling Paginate #289

Theme version

v2.4.0

Hugo version

hugo v0.105.0+extended darwin/arm64 BuildDate=unknown

What browsers are you seeing the problem on?

Chrome, Safari

Relevant Hugo log output

No response

@younsl younsl added the bug Something isn't working label Nov 13, 2022
@jpanther
Copy link
Owner

Thanks for the report, @seyslee. This is definitely an oversight on my part. I'll patch it in the next release.

@jpanther jpanther added the wip Work in progress label Nov 13, 2022
@jpanther jpanther removed the wip Work in progress label Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants