Hexo: How to split post like WordPress <!--nextpage-->

Created on 19 Feb 2018  Â·  4Comments  Â·  Source: hexojs/hexo

In WordPress, we can split post with the tag "<!--nextpage-->" in the post text, then output one post to consisted multiple pages like below...

http://example.com/permalink/?page=2
http://example.com/permalink/?page=3
http://example.com/permalink/?page=4
…
So, does anyone know how to same function in Hexo?

originalpost: https://groups.google.com/forum/#!topic/hexo/SH-QaSEEg4g

feature-request

Most helpful comment

Hi @kohki-shikata. That is an interesting question.

What about this?

<a id="page-marker-01" style="page-break-after: always;"></a>

This attribute id="page-marker-01" allows a link to the page. Example: http://example.com/my-blog#page-marker01

The attribute style="page-break-after: always;" will force a new page when printing.

Will that work for your purposes?

All 4 comments

Hi @kohki-shikata. That is an interesting question.

What about this?

<a id="page-marker-01" style="page-break-after: always;"></a>

This attribute id="page-marker-01" allows a link to the page. Example: http://example.com/my-blog#page-marker01

The attribute style="page-break-after: always;" will force a new page when printing.

Will that work for your purposes?

@tcrowe
I aim to get google's search evaluation as multiple pages. But, This method works only for single HTML file.
Thanks your idea, but I would like to wait little more other ideas.

Lets try another approach. Asset folders!

https://hexo.io/docs/asset-folders.html

hexo new post my-post

That will create a directory source/_posts/my-post AND a markdown file source/_posts/my-post/index.md.

More pages can be added in it:

touch source/_posts/my-post/part02.md
touch source/_posts/my-post/part03.md

Link to the pages:

[Pg 1](./index.html) [Pg 2](./part02.html) [Pg3](./part03.html)

That may accomplish similar to what you want. I will check for a multi-page plugin now.

I searched for "hexo plugin multiple page post" but I did not find anything yet. Are you good at JS? Can you make a plugin for this? It would be a good plugin to use with asset folders.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

icepy picture icepy  Â·  34Comments

tomap picture tomap  Â·  21Comments

fabien-h picture fabien-h  Â·  22Comments

fishercoder1534 picture fishercoder1534  Â·  26Comments

SukkaW picture SukkaW  Â·  25Comments