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

How to split post like WordPress <!--nextpage--> #3035

Closed
kohki-shikata opened this issue Feb 19, 2018 · 5 comments
Closed

How to split post like WordPress <!--nextpage--> #3035

kohki-shikata opened this issue Feb 19, 2018 · 5 comments

Comments

@kohki-shikata
Copy link

kohki-shikata commented Feb 19, 2018

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

@tcrowe
Copy link
Contributor

tcrowe commented Feb 19, 2018

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?

@kohki-shikata
Copy link
Author

kohki-shikata commented Feb 20, 2018

@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.

@tcrowe
Copy link
Contributor

tcrowe commented Feb 20, 2018

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.

@tcrowe
Copy link
Contributor

tcrowe commented Feb 20, 2018

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.

@stevenjoezhang
Copy link
Member

I will close this Issue because implementing this feature in Hexo is complex. If the input is a single Markdown file while generating multiple HTML outputs, it would require significant modifications to existing mechanisms (such as permalink and post asset), resulting in substantial maintenance costs.

I suggest implementing this through a frontend JS script within the theme. By using JS to analyze GET parameters and manipulate HTML, it can selectively display specific content on the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants