Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature request - custom page pagination, for data files #3423
Hexo and Plugin version(
How do I add pagination to a custom page? This was asked in issue #1743 but my situation is a bit different. I already have an archive page set up for my posts https://msanatan.com/archives/. I write blog posts for another website and would like my main blog to link to them.
The blog posts in the alternative site are stored as JSON, and my template loops through the JSON to create a page similar to archives https://msanatan.com/other-writing/. Unfortunately, the page variables used in pagination are only available to index and archive layouts.
I noticed this library https://github.com/hexojs/hexo-pagination but I'm not sure how to use it at the theme level to get pagination on my custom page. Any advice?
I have an idea @msanatan
--- title: Building a GraphQL API with Django date: 2019-01-20 16:34:58 categories: ["Other Writing"] link: https://stackabuse.com/building-a-graphql-api-with-django/ ---
Categories can be like this:
categories: - Other Writings
categories: ["Other Writing"]
Now that should be paginated.
Some unicode icons:
If you're able to change it from JSON into hexo posts this might work. Could you see if this solution works for your site?
It's a nice clean theme. Is that in the themes section or did you make it?
Take care 👋🏻
Hey @tcrowe, thanks for your quick reply! I got to step out for a bit but I'm pretty excited to try it out your suggestion when I reach back :-).
I forked the theme from https://github.com/probberechts/hexo-theme-cactus, which I found on the themes section on the website. I only made some modifications to change the logo and have a contact page, all credit goes to probberechts!
Thank you too. This theme may have support for
added a commit
Jan 21, 2019
Hey @tcrowe, your suggestion worked like a charm. I modified my web scraper to produce markdown files with an 'other' category (didn't seem to like the 2 words but no worries) and made the necessary theme changes. It's also more sustainable as I may write to other sources as well, this is a great way to pull them together.