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 works only in the homepage [BUG] #910

Closed
anapaulagomes opened this issue May 3, 2024 · 7 comments · Fixed by #912
Closed

Pagination works only in the homepage [BUG] #910

anapaulagomes opened this issue May 3, 2024 · 7 comments · Fixed by #912
Labels
bug Something isn't working

Comments

@anapaulagomes
Copy link

Describe the bug

First of all, thanks for your help and for this great theme!

The paginate param only works in the homepage. When the user clicks on "More", it goes to a page with all posts with no pagination.

I'm not sure if this is a bug or a configuration that I'm missing but even after changing the layout to cards and play with the params on the section, I couldn't get this to work.

To reproduce

Steps to reproduce the behavior:

  1. Create a new website following the instructions https://gethinode.com/docs/getting-started/introduction/#installation
  2. Add to the content directory a _index.md file and create a directory called dogs with 10 posts inside (ideally with draft=false).
  3. Run hugo server. You should see the home page and all posts as follow:
print1 print2

*For the example in the screenshot, I've generated 25 posts.

Expected behavior

By default, the paginate param is set to 9. And this is respected in the front page.
I expected that the http://localhost:1313/dogs/ page would display two pages ([1], [2]), one with 9 posts and another one with one post.

Host environment

  • Hinode version: v0.23.11
  • Host OS: Windows 11
  • Node version: [e.g. node v18.15.0]
  • Browser: Firefox 125.0.2 (64-bits)

Hugo environment

Copy the output of hugo env or npm run env here.

hugo v0.124.1-db083b05f16c945fec04f745f0ca8640560cf1ec+extended linux/amd64 BuildDate=2024-03-20T11:40:10Z VendorInfo=gohugoio
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.22.1"
OptionParser::InvalidOption: invalid option: --embedded
  Use --trace for backtrace.
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"

Additional context

I'm terrible with frontend, so bear with me. :)

@anapaulagomes anapaulagomes added the bug Something isn't working label May 3, 2024
markdumay added a commit that referenced this issue May 4, 2024
@markdumay
Copy link
Collaborator

Thanks for spotting this @anapaulagomes! This commit introduced an unwanted side effect. I will release a fix soon.

@markdumay
Copy link
Collaborator

The fix is addressed in release v0.23.12.

@anapaulagomes
Copy link
Author

anapaulagomes commented May 4, 2024

Hi @markdumay! Thanks a lot for the fast reply. The change worked for the site I created for this issue example but not for my own website. I believe that it is because the sections configuration are different and not all uses the card-groups. Does it make sense? Below the configurations:

[sections]
    [sections.one]
        title = "One"
        sort = "date"
        reverse = true
        cols = 3
        color = ""
        padding = "0"
        header = "tags"
        footer = "none"
        orientation = "stacked"
        style = "border-0 card-zoom card-body-margin"
        homepage = 6
        separator = true
        nested = true
    [sections.blog]
        title = "Blog"
        sort = "date"
        reverse = true
        cols = 1
        background = "body-tertiary"
        color = "body"
        padding = "3"
        header = "none"
        footer = "tags"
        orientation = "horizontal"
        style = "border-1 card-emphasize"
        homepage = 3
        separator = false

I appreciate your help.

@markdumay markdumay reopened this May 4, 2024
@markdumay
Copy link
Collaborator

That's weird, as your configuration seems to use the default layout type for both one and blog. I tested your section configuration with the Hinode example site, and it seems to work as expected. Could you perhaps share the steps how to reproduce this, or share a (minimal) test repo that illustrates the issue?

@anapaulagomes
Copy link
Author

I'll do it over the week! Thanks a lot Mark.

@anapaulagomes
Copy link
Author

Hi @markdumay, I've checked the example I created with the configuration and the content from my website and the pagination worked. I still have to look further to investigate why is not working, so I think you can consider the issue fixed. Thank you so much for looking into this!

@anapaulagomes
Copy link
Author

After I updated the modules and deleted the vendor directory (?), it is working. Thanks lot! 🏆

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

Successfully merging a pull request may close this issue.

2 participants