#microformats 2021-01-05

2021-01-05 UTC
#
@kalanKDavis
↩️ Ah nostalgia. Not to worry, anyone that knows the beauty of and difference between their microformats is a friend in my (very small) book.
(twitter.com/_/status/1346314041761923077)
[tw2113_Slack_], [snarfed], [xavierroy], jacky, strugee, [KevinMarks], jamietanna and [Roy_Mosby] joined the channel
#
[Roy_Mosby]
Hi channel! Are there any resources for using a microformat with a Eleventy and markdown? I have a hobby recipe site that I would love to make compliant with hRecipe.
#
@harrisj
↩️ Of course, we’re still embedding microformats in the generated HTML, right?>
(twitter.com/_/status/1346461208438833153)
KartikPrabhu and btrem joined the channel
btrem joined the channel; btrem left the channel
#
btrem
https://chat.indieweb.org/microformats/2021-01-05/1609854311500600 I don't know of any resources, but I'm new to 11ty. Two things:
#
Loqi
[[Roy_Mosby]] Hi channel! Are there any resources for using a microformat with a Eleventy and markdown? I have a hobby recipe site that I would love to make compliant with hRecipe.
#
btrem
(1) Consider using h-recipe, the microformats 2 version of hRecipe (with backward compatible classes to cover all bases if you want)
#
btrem
(2) I'd think it'd be hard to use microformats in markdown. Adding classes can be a bit klunky. But you could insert html markup inside your markdown templates. Probably not what you want. :/
[Roy_Mosby] joined the channel
#
[Roy_Mosby]
↩️ I’ve considered trying multi-markdown which will allow for attributes but wanted to see if someone has explored that already or if there are other options out there such as plugins that may just focus on adding classes & ids to rendered elements.
#
btrem
I'm not sure how something like that would work. As I said, I'm new to 11ty, but so far I see it as a fairly lightweight static site generator. There's no database, so how would one automate assigning classes to bits of content?
#
[Roy_Mosby]
I’m not really sure other than something that would override the provided markdown processor. I’ll continue looking around and I’ll speak up if I figured something out.
[jeremycherfas] joined the channel
#
btrem
Are you looking for a replacement markdown processor? I thought you were already using one. I guess I'm trying to imagine what you think an 11ty plugin would do in regards to microformats.
#
btrem
I suppose one could imagine a custom template/layout. With a json object to store the data. Are you recipes in a database on your pc/mac/whatever?
#
[Roy_Mosby]
I’m currently using markdown-it inside Eleventy because of another plugin for footnotes. I was kinda hoping to stick with that if at all possible. All my recipes are in markdown so I can move them around- plus they’re easier to maintain manually than JSON would be.
[Raphael_Luckom], [snarfed], [tantek], [schmarty], gRegorLove, [KevinMarks] and [tw2113_Slack_] joined the channel
#
btrem
@[Roy_Mosby] That makes sense. If markdown is more usable to you -- and why wouldn't it be? -- then use it. No point in switching to json.
#
btrem
But then I'm wondering what you're looking for in a plugin. If you can specify what you would want a plugin to do, maybe someone here can provide a solution of some sort. Do you want something to scrape your content and add classes?
#
[KevinMarks]
Markdown should allow inline html and pass it through, so you could add that to parts of the recipe pages.
#
[KevinMarks]
That means that you can use html idioms that don't have markdown equivalents too (like details/summary)
#
Loqi
[btrem] (2) I'd think it'd be hard to use microformats in markdown. Adding classes can be a bit klunky. But you could insert html markup inside your markdown templates. Probably not what you want. :/
#
btrem
It's hard to tell what @[Roy_Mosby] is hoping for. His recipes are already in markdown, but without hRecipe classes. He seems to want a plugin that will automatically add them. I don't see how that would be possible.
[frank], [Raphael_Luckom], KartikPrabhu, jamietanna, [tantek] and [Roy_Mosby] joined the channel
#
[Roy_Mosby]
As I said earlier, I’ll look around to see if I find anything and then chime back up. I think markdown-it-attrs may fit what I am looking for. Again, I’m not looking for something that can parse the recipe and add in the needed classes, I just would like get them in similar to how multimarkdown allows.
[snarfed] and btrem joined the channel
#
btrem
Now comes the more rewarding part of my 11ty site makeover: adding h-entry classes. :)
#
[KevinMarks]
Hm. Now I'm wondering if I could do a thing that makes a nunjucks template from an mf2 marked up page
#
btrem
I'm working on a nunjucks template for article pages, that is, a page that is one article (and the url is the permalink). And of course I immediately run into problems. :/
#
btrem
I need to be able to attach h-entry to the body tag, because it won't work on the main tag. Dang, gotta redo some things.
#
[KevinMarks]
Like it finds <main class="h-entry" ><h2 class="p-name" >My Post</h2><section class ="e-content" >the body </section ></main> and makes <main class="h-entry" ><h2 class="p-name" >{{entry [0].name}}</h2><section class ="e-content" >{{entry [0].content | safe}} </section ></main>
#
btrem
Except that there is no <h2> inside <main>. There is instead an <h1> inside <header>. This is, after all, a page for a single article.
#
btrem
Oh, sorry, I just realized you weren't responding to me. Never mind. As you were. :)