#microformats 2025-12-11

2025-12-11 UTC
Dryusdan and alabut-on-his-ce joined the channel
#
[Al_Abut]
oof, I can’t decide if microformats should be my create day project for day 2 of IWCSD
#
[Al_Abut]
I’m leaning towards “yes” for making a page-feed-combo-thingy for my photos
#
[Al_Abut]
probably going to have to make a whole new page with just the photos, not the albums, right…?
sebbu2 and m0suli joined the channel
#
[tantek]
[Al_Abut] happy to help add relevant mf2 to your existing photos pages first to see if that works for the use-cases you're considering
#
[Al_Abut]
oh nice, yeah that’d be great to get your eyes on this because I don’t think I can wait until Sunday to tackle it
#
[Al_Abut]
partly out of enthusiasm but also because the script I have would be way better if instead of “I’m excited about adding microformats” I said “I did add it and it was super easy”
gRegor joined the channel
#
[Al_Abut]
So here’s why I thought I’d have to make a new page - I have two types right now, one I call the gallery:
#
[Al_Abut]
Which doesn’t seem to map cleanly to the gallery definition in our wiki, where it seems to be defined as synonymous with albums or collections. I’ve been using it to mean the view of those types of posts, if that makes sense, so a gallery is like an album of albums…?
#
[Al_Abut]
Then there’s each album itself:
#
[Al_Abut]
I guess I could make that first gallery page a feed and each thumbnail would then link to the respective album, but I prefer to have full-content feeds instead. So to do that I’d have to make a new page that has all of the photos from all of the albums, right? With the photos sorted in reverse chrono and grouped into “posts” for each album. Then every other page would link to that one as the feed view.
#
[Al_Abut]
Does that make sense? Am I overthinking the architecture?
#
[Al_Abut]
also, no worries if this doesn’t make sense over text, it can wait until iwcsd, no problem
#
[tantek]
yep, this might work better for in-person chat on Friday to better understand what you're trying to do
#
[Al_Abut]
Sure thing!
#
[Al_Abut]
I have a lot of basic ground to cover before then anyway. I’m cruising through MDN right now.
#
ulhar4409
Hmmm, an "album of albums" might be a good pattern to have in my toolset too (what if i draw a multipage sequence, for example ~~unlikely with my time and spoons but yknow~~), so I'd be interested to see how that works out
#
[Al_Abut]
That’s an interesting generalization. I guess that would apply to category or topic pages?
m0suli joined the channel
#
ulhar4409
maybe, i think this notion would be somewhere between a full *category* (indefinite extent) and a post (instantaneous)
#
[Al_Abut]
Yeah, I can see that. For my specific use case, it feels like a short description-only feed vs one with full content. My current gallery page would be the description only feed because it would just have the thumbnail for an album and link to the full thing, so that’s why I’m thinking I need a new page that has all of the photos in them to be full content.
#
[Al_Abut]
[tantek] ok, I think I’ve got a working demo of what I was trying to describe and it seems to work in the Monocle preview tool.
#
[Al_Abut]
I started with a feed where each item is a single photo, like in my gallery view: https://alabut.com/projects/microformats/photos/photo-feed/
#
[Al_Abut]
Ideally you’d want to be able to alternate between posts that have a single photo or a set of photos, like the post vs carousel on IG: https://alabut.com/projects/microformats/photos/combined-feed/
#
[Al_Abut]
Then I made each entry have multiple photos, like I’d want from a “full content feed” I was trying to describe earlier: https://alabut.com/projects/microformats/photos/album-feed/
#
[Al_Abut]
But have no idea if the rest of it is valid because the state of microformats validators is extremely confusing to me at the moment.
#
[Al_Abut]
But if I’m on the right track, then tomorrow I’ll start trying to figure out Granary
gRegor joined the channel
#
[Al_Abut]
Oh holy 💩 Granary turned out to be the easiest part! I just walked through [capjamesg] tutorial and ended up with this:
[dshanske], GWG, [artlung], [morgan], [jeremycherfas], [jeremycherfas]1, [artlung]1 and sebbu3 joined the channel
#
[Al_Abut]
Oops, I got on a roll and I’m still up. I made a feed of all my photos, sorted by albums!
#
[Al_Abut]
The page/feed combo: https://alabut.com/photos/feed/
#
[Al_Abut]
The Monocle preview: https://monocle.p3k.io/preview?url=https%3A%2F%2Falabut.com%2Fphotos%2Ffeed%2F (not sure why the third article is jigsawed like it’s missing images when it isn’t)
#
[Al_Abut]
Would love some pointers or corrections on the underlying markup or anything else. Woooo…
[Murray], [Trevor_Morris], Dryusdan and jacky1 joined the channel
#
jacky1
This is going to be my contribution to the indieweb advent https://imgur.com/a/uBh2GlS
#
jacky1
almost done with it but this has been on my todo list for a _while_
[schmarty] joined the channel
#
[schmarty]
jacky++ wow!
#
Loqi
jacky has 2 karma in this channel over the last year (6 in all channels)
#
[Al_Abut]
Very cool. Also - is there a comprehensive reference list of classes somewhere? The hardest and most mysterious part turned out to be finding them and I still don’t know if I’ve used the right ones. All the docs have wildcard statements like u-*
[manton] joined the channel
#
[schmarty]
[Al_Abut] i'm not aware of a flat listing, but there are some published vocabularies and suggested properties: https://microformats.org/wiki/Main_Page#Vocabularies
#
[tantek]
[Al_Abut] as a publisher you only have to support the class names you see in the vocabulary specs that apply to your content
#
[tantek]
All the u-* etc docs are for parser implementers. Is that you?
jacky1 joined the channel
#
jacky1
It's derived from the Microformats wiki, yeah. Wasn't hard to turn it into a schema (this'll emit that too so JSON Schema could be used but obviously, YOLO)
vhbelvadi joined the channel
#
[Al_Abut]
↩️ Good god no 😆
#
[Al_Abut]
Also the photo-specific seems stalled or stubbed out? E.g. u-photo is a 404 in the wiki search, even though it shows up briefly in places like that page.
gRegor joined the channel
#
[tantek]
The wiki doesn't have pages for specific properties in general. Only for root class names which are also the names of the microformats (in mf2)
#
[tantek]
[Al_Abut] when you say "All the docs ... have u-*" can you be more specific? Really curious where you encountered that as a publisher and I'd like to avoid that as a source of confusion
#
[tantek]
E.g. none of the vocabulary pages should any such "wildcard statements" so if you ran into that its probably a bug I need to fix
#
[Al_Abut]
I can try to retrace last night’s steps. Might be futile - I opened a flurry of tabs trying to find and make sense of which classes I was supposed to be using.
#
gRegor
[Al_Abut], if you're curious about the naming conventions and how they should parse, this section might help: https://microformats.org/wiki/microformats2-prefixes#naming_conventions_for_generic_parsing
#
gRegor
That (intentionally) lists the wildcard syntax. Might help when you're reading a specific spec like https://microformats.org/wiki/h-entry to understand why some properties have a p- prefix vs a u- prefix, etc.
[aciccarello], barnaby and Dryusdan joined the channel
#
ulhar4409
are there any particular properties that cannot reasonably be plural?
#
ulhar4409
i am probably going to roll an MF2 parser in common lisp at some point but i'm not quite sure what the cleanest interface design for it would be (for interacting with MF2-structured data in general, but even representing the data to begin with)
[snarfed] joined the channel
#
[snarfed]
ulhar4409 the short answer is, all properties are plural in that they can be multiply-valued and parsed into lists, whatever the language's representation of that is
#
[snarfed]
from https://microformats.org/wiki/microformats2#v2_vocab_notes : "All v2 vocabularies are defined as flat lists of properties of an object/item"
#
[snarfed]
in practice, many properties almost always have just one value, at most, but I think mf2 was designed to make everything multiply valued to simplify/standardize consuming code
#
ulhar4409
i see i see, it *would* be pretty annoying to differentiate between "has exactly one value" and "has multiple values"
#
ulhar4409
in my case though it is already annoying to account for a property being potentially absent (so really, any property) which is probably just a weakness of "I didn't feel like writing accessors"
#
[snarfed]
plenty of structured data frameworks do single vs multiple vs nullable etc, mf2 is unusually that it doesn't, but it's trying to cater to web publishers, which (the mf2 designers maybe thought) tend to be less technical and less interested in getting technical specifics right, so it tried to be simple and forgiving
#
ulhar4409
yeah that's fair
#
ulhar4409
it does leave me with some tricky questions of how i'd want to access a "singlet" vs a "multiplet" though (maybe `prop1` vs `propn`? though might be easy to mistake for `prog1` and `progn` which CL already defines)
#
ulhar4409
oh, and what of the `type` field? is that a reasonably-assumed singlet?
jeremycherfas joined the channel
#
ulhar4409
ok nope, encountered a counterexample on the page. but for rendering my own pages it's probably a reasonable assumption?
#
[snarfed]
you know your own data, you can impose any additional constraints you want
#
ulhar4409
~~when you own your data you can finally known your data~~
#
gRegor
If it's intended for broader use though, yeah, `type` should allow multiple values
#
gRegor
Some additional libraries outside of parsers have been made in PHP and Python that add some convenience, like returning the first value for a property when that's what you want in a majority of cases
#
ulhar4409
Oh, come to think of it, maybe some signature like `(prop place id &optional (n 0))` would be good?
#
ulhar4409
So that the same accessor can be used for "singlets" and "multiplets" alike (it needs to index an array anyway, right?)
#
ulhar4409
I'm curious to see those libraries though, maybe those conveniences would be helpful to port to my own setup
#
gRegor
https://github.com/barnabywalters/php-mf-cleaner is the PHP one I'm more familiar with, might find some ideas there: https://github.com/barnabywalters/php-mf-cleaner
#
Loqi
[preview] [barnabywalters] php-mf-cleaner: Allows easy, reliable manipulation of canonical microformats 2 data structures.
#
gRegor
Python one I think is "mf2 utils", looking for it