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 #10

Open
krusynth opened this issue Aug 22, 2024 · 1 comment
Open

Pagination #10

krusynth opened this issue Aug 22, 2024 · 1 comment

Comments

@krusynth
Copy link

In most cases, it's very likely that an h-feed list of entries on a page is on a summary page - like a homepage list of recent posts, or a category page of posts, etc. In those cases, there's almost always pagination on the page, and the posts are a subset of the total collection. I assume we need some sort of rel="next" or rel="previous" markup for links here?

I apologize if I've missed an existing solution here!

@gRegorLove
Copy link
Member

Yeah, I think adding rel="next" and rel="previous" to navigation links you have on such a summary page would work. microformats2 parsers will extract those in the rels and rel-urls.

I'm not sure if any consumers of h-feed use those rels yet, but experimentation is welcome!

<div class="h-feed">
  <div class="h-entry">
    <h1 class="p-name">A post</h1>
  </div>
</div>
<a href="/next" rel="next">Next</a>

parsed:

{
    "items": [
        {
            "type": [
                "h-feed"
            ],
            "properties": {},
            "children": [
                {
                    "type": [
                        "h-entry"
                    ],
                    "properties": {
                        "name": [
                            "A post"
                        ]
                    }
                }
            ]
        }
    ],
    "rels": {
        "next": [
            "/next"
        ]
    },
    "rel-urls": {
        "/next": {
            "text": "Next",
            "rels": [
                "next"
            ]
        }
    },
    "debug": {
        "package": "https://packagist.org/packages/mf2/mf2",
        "source": "https://github.com/indieweb/php-mf2",
        "version": "v0.5.0",
        "note": [
            "This output was generated from the php-mf2 library available at https://github.com/indieweb/php-mf2",
            "Please file any issues with the parser at https://github.com/indieweb/php-mf2/issues",
            "Using the Masterminds HTML5 parser"
        ]
    }
}

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

No branches or pull requests

2 participants