microformats / h-feed

For collecting and handling issues with the h-feed vocabulary specification: http://microformats.org/wiki/h-feed
3 stars 2 forks source link

Pagination #10

Open krusynth opened 2 months ago

krusynth commented 2 months ago

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 commented 2 months ago

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"
        ]
    }
}