Giter VIP home page Giter VIP logo

Comments (6)

Keats avatar Keats commented on May 18, 2024

Now that we have a _index.md for sections we could use its front matter to setup pagination but that doesn't really work in the case of a simple blog with only posts.

We could have a default pagination setting in config.toml for that case but it feels like having the behaviour in 2 places.

The sensible way (it seems) is to:

  • have a default for pagination in config.toml: defaults to no pagination but can be set up to paginate by setting num_per_page, pagination_path and paginate. This will apply to the index only.
  • Sections have to enable paginations and can override num_per_page and path_name in their frontmatter, no pagination will be created implicitely.

pagination_path is the path to be used in the URL, it could be page by default. It would like mysite.com/page/2 etc in that case.

That should cover 99% of the cases

from zola.

Keats avatar Keats commented on May 18, 2024

We could also have a _index.md for the actual index page instead of putting the default in the config but I'm not sure it's worth it.
In practice, in a mixed content site (landing page + blog for example), the index page will not be the one paginated. I can't think of an example where it would be the case: paginating different kind of content doesn't really make sense.

from zola.

Keats avatar Keats commented on May 18, 2024

No clue on how to handle pagination for the index page: what do you do if you have a couple of static pages + posts? Having your about page in the pagination doesn't make sense.

I'll only paginate sections for now and we can figure out the index section later (maybe only paginate pages that have a date or a weight?)

from zola.

Keats avatar Keats commented on May 18, 2024

See #34 for basic implementation, doesn't paginate index page yet

from zola.

Keats avatar Keats commented on May 18, 2024

Will be easier after #14 to generalise I think and with the _index.md for the index page

from zola.

Keats avatar Keats commented on May 18, 2024

#55 should do the trick

from zola.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.