#dev 2021-04-29

2021-04-29 UTC
[schmarty], sparseMatrix, [tantek], [tw2113_Slack_], Seirdy and nertzy_ joined the channel
#
doosboox
hah, that was funny :)
[KevinMarks] joined the channel
#
Loqi
ok, I added "https://twitter.com/vponamariov/status/1387411278432460801?s=20" to the "See Also" section of /markdown https://indieweb.org/wiki/index.php?diff=75445&oldid=74397
nertzy__, __minoru__shirae and tarball777 joined the channel; enpo left the channel
#
tarball777
Hi! I would want to prototype a webring (decentralized web pages with common navigation) using webmentions. I am wondering if the webring users (thos who will make webpages part of the ring) are supposed to run a specific command to “send” the mention to the webring owner.
#
tarball777
I can’t really understand if only the receiver needs to run a command, or to use a server-side script, or if the senders also needs to do so.
#
doosboox
tarball777: basically the idea is that A publishes a page APOST, then runs a tool that finds all URLs mentioned in APOST. For each URL in that list it gets the URL target, then parses that to find a "link rel='webmention'" (I think it could be returned in the http header as well). If it finds one it posts a webmention to that endpoint (which is the
#
doosboox
receiver B in this example)
#
doosboox
tarball777: alternatively A might not have an automated sending mechanism, but knows that B has a webmention endpoint and is able to curl it manually. Sometimes B has a form for webmentions on their site.
#
doosboox
tarball777: B receives the webmention, and gets the URL that supposedly mentions it to validate that it actually does. This can be a manual process, too. Maybe B stores a list of received webmentions and goes through them on Sunday evenings while having a cup of tea and listening to heavy metal.
#
tarball777
I see @doosboox that’s very clear. In my case I can’t be sure all the A will be able to run anything. But the form option is interesting!
#
tarball777
thank you for you quick help.
[KevinMarks] joined the channel
#
[KevinMarks]
there are several tools that can send all the webmentions for an A anyway that work by parsing the page
[kimberlyhirsh], __minoru__shirae and [schmarty] joined the channel
#
[schmarty]
some discussion in chat had me thinking about https://www.manton.org/2021/04/19/how-does-microblog.html again
#
Loqi
[Manton Reece] How does Micro.blog even work?
#
[schmarty]
!tell manton in your "How does Micro.blog even work?" post you mentioned a fast build step to get the initial post permalink up before rebuilding the rest of the site. would you be willing to talk at a high level about how you do that?
#
Loqi
Ok, I'll tell them that when I see them next
#
[schmarty]
for my personal site, my micropub handler writes files, calls hugo to build, and publishes the resulting files. waiting for the full build can be very annoying when i just want a single new post to go up and send webmentions.
#
[schmarty]
i've thought about trying to make a shrunken/sandboxed copy of my hugo site with just enough templates to build permalink pages and do a first-run where i only give it the new or updated post to build
#
[schmarty]
but that feels like a lot of work to maintain and edge case around
[tantek] and [grantcodes] joined the channel
#
@AvniGupta_
↩️ React.js Project Ideas 1. Map Statistics Dashboard 2. Musical Instrument 3. Personal Portfolio 4. Notebook 5. Space Invaders Game 6. Framework Theme 7. Webmentions 8. Zoom Clone
(twitter.com/_/status/1387786950141112320)
#
aaronpk
i would argue that's not an edge case since it would happen on every new post :D
[tw2113_Slack_], barnabywalters, alex11, [KevinMarks], __minoru__shirae, minoru_shiraeesh, [kimberlyhirsh] and [aciccarello] joined the channel
#
jacky
[schmarty]: I wonder if he has the first post one could make as a static template somewhere and just generates that before _actually_ hitting Hugo
#
jacky
that way, it can concurrently run the actual build to keep the incremental build cache warm
KartikPrabhu joined the channel
#
[schmarty]
jacky: ah that is an interesting idea! i think it would still require duplicating a lot of hugo's logic to figure out things like the post permalink (e.g. what collection does it belong to, etc.), but a "generic" template that doesn't necessarily look like the site itself would work for webmention parsing
#
[schmarty]
kind of assumes that a human won't see it until hugo is done though
#
jacky
I'm assuming that from what he mentions around the speed to timeline (SoT)
#
[aciccarello]
I know 11ty is trying to figure out how to incremental builds
#
[aciccarello]
Knowing what will change is a hard problem
#
Loqi
[zachleat] #108 --incremental Build, only process files that have changed.
#
[aciccarello]
Hopefully that matures and netlify makes it easier to manage caching
#
[KevinMarks]
the ripple effect if your tag pages are chronological can be big
#
[schmarty]
things like rebuilding all tag pages (and archives) are why i want to have more control over when things happen. first build and publish the permalink page and start sending webmentions. then update any "main" feeds (and send websub notifications). then start the longer process of building out alternate views like tags, archives, indexes, ...
#
jacky
heh reading this post actually makes me glad from [manton]
#
jacky
like the replies have people who aren't familiar or don't understand some stuff - which means he's done an excellent job of abstracting the platform so people focus on doing what they want
#
jacky
[manton]++
#
Loqi
[manton] has 15 karma in this channel over the last year (23 in all channels)
#
sknebel
I also think that one trap is that it is a feature thats somewhat hard to retrofit
#
sknebel
and you can do some tricks. e.g. chronological archives means archive changes do not ripple through everything
#
sknebel
caching of elements of course makes rebuilding archives faster
#
doosboox
[KevinMarks]: I don’t know what to think about centralised services for webmentions (or indieauth for that matter). I feel like relying on central services defeats the purpose of being outside of silos
#
[schmarty]
it might be time to revisit my chronological archives on hugo. at the time i could only get them working with what i consider to be weird backflips and i think they probably slow things down.
#
doosboox
[schmarty]: do you have a version of them live somewhere now?
#
jacky
doosboox: I can see that
#
jacky
ideally, everyone's site would have these things baked in
#
[KevinMarks]
sending webmentions is still setting up an edge to edge connection
#
jacky
but also having public 'relays' for things like webmentions or websub help reduce load for people
#
barnabywalters
yeah, there’s a huuuge gap between “setting up a simple HTML+css site/static site generator” and “writing or setting up and managing a piece of software which interacts securely with other servers and content”
#
doosboox
Websub is something I’d like to implement at some point. Running my own hub for just my domain would reduce workload if it would replace a bunch of polling to my feed :)
#
barnabywalters
services like indieauth.com and webmention.io help bridge that gap
#
doosboox
barnabywalters: I definitely see how it does. Having to set up your own site is already a pretty big hurdle for a lot of people
#
barnabywalters
and yes, they’re centralised, but they’re based on standards which anyone can implement and interop with, so there’s little-to-no entrenchment
#
barnabywalters
I can send webmentions to a site which is using webmention.io without ever knowing or caring that they’re using it
#
barnabywalters
and they could switch to another webmention handler without anyone having to know or care
#
doosboox
True
#
barnabywalters
and no data is lost if webmention.io goes down or disappears for any reason
#
barnabywalters
so there are plenty of differences between interim measures like these and siloed content and UX
#
jacky
wow yeah you're right barnabywalters
#
jacky
like if someone really did want to just "transfer" Webmention providers, they'd just have to fire off all of the Webmentions possible for their site
#
jacky
it'd probably end up being more 'fresher' than doing an export (though _some_ data loss can occur if like you had a Webmention that wasn't ever requested to be deleted but is from someone whose site went away and hasn't come back up)
#
jacky
but that's edge-case-y
#
barnabywalters
jacky: that occurred to me too, but yes it’s an edge case, and also it’s more of an archival issue than a webmention issue, considering that if handled “correctly” the mention would have been deleted anyway
#
barnabywalters
my site internally archives pages which webmention me (and those which I link to), but that’s separate from the webmention handling, so if a webmention gets deleted (which I still need to implement…) I still have the archive
#
barnabywalters
but that’s a feature of my site, not something inherent to webmention
#
barnabywalters
IIRC aaronpk has a similar internal archive
#
jacky
I have something similar running on https://v2.jacky.wtf (I hash the URL to the raw HTML contents of the sending page)
#
barnabywalters
wow, I have 253 MB of archived data
#
barnabywalters
not sure if that’s a lot or a little tbh
#
barnabywalters
that’s uncompressed, too. I might change the implementation to write directly to a zip archive in the future if it gets too much
#
[tw2113_Slack_]
wait till you get to the TB territory 😉
#
jacky
if it's only HTML, then wow
#
barnabywalters
[tw2113_Slack_]: at my current rate of ~30MB per year, it’ll take me only around 35000 years
#
barnabywalters
so I have plenty of time to implement the zip writing
#
barnabywalters
yeah, only HTML and HTTP headers
#
barnabywalters
it’s an opinionated archive ;)
#
barnabywalters
I figured I can rely on the internet archive for anything more than that
#
barnabywalters
but there’s no excuse not to at least store an HTML copy of everything I’ve ever linked to
#
jacky
depending on the number of outgoing links you have ;)
#
jacky
but yeah actually, I don't know why I haven't considered using the Internet Archive for something like that
#
jacky
or a cluster of archiving sites
#
jacky
that's the _one_ thing I find that Hypercore could help with (automatic archival of pages as people browse - depending on how much they're willing to anonymously capture for people)
#
[schmarty]
doosboox: the archive pages are public but I haven't published the source templates etc for my site
#
jacky
yeah!
#
barnabywalters
looks vaguely interesting
#
jacky
tl;dr: it's torrenting for web pages
#
barnabywalters
I realised recently that stuff like this (anything with peer-to-peer or blockchain in) is where my BS-detection intuition runs dry
#
barnabywalters
I just don’t know enough about the problem space to be able to tell if a particular approach makes sense or not
#
jacky
tbh it's "a" solution
#
jacky
wouldn't pitch it as _thee_ solution
#
jacky
but it's friendly to sneakernet-y situations
#
doosboox
[schmarty]: Caaaaats ❤️
#
doosboox
[schmarty]: what is it about generating the archive that causes issues for you?
#
[schmarty]
doosboox: cats is probably 90+% of my content these days 😅
#
aaronpk
cats++
#
Loqi
cats has 1 karma in this channel over the last year (3 in all channels)
#
[schmarty]
Ah, yeah. Hugo doesn't (didn't) have a way to build date-based archives like /year/month/. So I adopted someone's hack where I make a separate "content page" for each month and the template for those content pages looks up all the posts that fit within that timeframe
#
doosboox
cats++
#
Loqi
cats has 2 karma in this channel over the last year (4 in all channels)
#
doosboox
ah, right
#
doosboox
is one of those loons that rolled his own static site generator
#
[schmarty]
So the /2021/04/ archive page is a yaml file with month: 04 and year: 2021. I think having the template query all my posts for every month is probably not optimized at all by hugo but it's just a hunch because it feels like a hack.
#
[schmarty]
I have been sorely tempted to roll my own 😅
#
Poorchop
I've been writing my own, it's the only way to go
#
[schmarty]
looks back down the road at all the site generators I have built and abandoned
#
[aciccarello]
Is there anything on Date Base Pagination other than the [[pagination]] page?
#
Poorchop
I don't know if a 20 line script can count as a static site generator but it statically generates my site
#
jacky
I mean it sounds like it does the job
#
Poorchop
only one that I know of that allows for writing html instead of markdown
#
[aciccarello]
Technically you can write HTML in a markdown file 😉
#
Poorchop
touche my friend
#
[aciccarello]
I'm actually curious if anyone with a git based SSG & micropub post HTML to a markdown file. 🤔
#
doosboox
I write my source files in gemtext. Some is converted to html and posted to my blog, some is posted to my gemlog, and most posts are on both.
#
[schmarty]
I have occasionally thrown html into posts on my site which works as you described aciccarello
#
[schmarty]
(Mostly for stuff like before I built in support for RSVPs, or when experimenting with other microformats)
#
[aciccarello]
I'll sometimes add HTML in a post if I want to add rel= info on hrefs
#
jacky
kinda same
[manton] joined the channel
#
[manton]
[schmarty] Just catching up… It’s similar to what [jacky] said. I basically run Hugo on a subset of the site first. The theme and all the core files, but only recent posts needed to construct the home page and permalink for the new post that was just written, and I skip updating some pages like the archive or photos list. Then I run a 2nd pass on it with a totally full content folder. (Still tweaking some of this.)
#
Loqi
[manton]: [schmarty] left you a message 3 hours, 41 minutes ago: in your "How does Micro.blog even work?" post you mentioned a fast build step to get the initial post permalink up before rebuilding the rest of the site. would you be willing to talk at a high level about how you do that?
#
[schmarty]
manton: thanks! that's very inspiring! Is it a lot of file juggling? (It seems like it's a lot of file juggling of post data and template files)
#
GWG
[schmarty]: Your site/name came up at HWC last night, re reacjis
#
[manton]
Yes, lots of file juggling! One of the challenges is that I run the background tasks like this on 3 servers. Everything in the file system on those servers is kind of like a cache, so it needs to do some prep work before it can run Hugo on any given server.
#
[schmarty]
GWG sorry I missed it! I sometimes wonder if I should post more reacjis 😂
#
GWG
It was a good conversation
#
[schmarty]
manton: ah wow, yeah! That makes sense!
#
[manton]
Happy to answer other questions if you have any. I haven’t totally figured this out myself, but I’ve made good progress… It is way faster than it used to be.
#
[schmarty]
manton: I guess I am most curious if you subset any of the theme template files on the quick build, or if limiting the content files to recent posts is "enough"?
#
[manton]
[schmarty] Currently I include all the theme template files too in the subset. Even if I might not push all of them live right away, it is hard to unravel what a blog might need in the theme, so I just include everything.
#
[manton]
Also as part of this 1st “phase”, I want to make sure the RSS and JSON Feed are updated, since that controls it appearing in the Micro.blog timeline.
#
[schmarty]
That fits my understanding! So I guess a major trick then is choosing which files out of the quick build subset to publish
[tantek] joined the channel
#
[manton]
Yeah, I manage all the blog posts and replies in MySQL, so I can pretty quickly pull out things like recent posts and save them as Markdown with front matter. Might be trickier to manage if there’s not a database to help track things.
#
jacky
interesting, this is close to what I've done with Koype (storing file hints/metadata into the db but everything else into an object storage setup)
#
barnabywalters
yep, I do something similar in taproot. all my posts are stored in the filesystem, and then metadata used for indexing them is stored separately in a disposable format
#
[schmarty]
Ah, sorry, I meant like knowing to publish the feeds and index pages from the quick build and not publishing like incomplete tag pages
#
barnabywalters
filesystems and databases excell at quite different things, makes sense to use them both for what they’re good for
#
Poorchop
I'm surprised that people prefer markdown over html
#
Poorchop
there are too many markdown flavors and I can't ever remember things like []()! or [!]() or is it ![]()
#
barnabywalters
I author posts in markdown for convenience, but only save the rendered HTML
#
Poorchop
and is bold *word* or **word** and what is italic and what is underlined, and how do I combine them? I have to look these things up constantly when I'm forced to use markdown
#
jacky
Poorchop: the woes, lol
#
jacky
I feel like every editor that hints at using Markdown needs to link to a syntax guide
#
jacky
like even for HTML, link to MDN or something
#
jacky
(that's one thing I've heard from some friends from the MySpace/Tumblr days - they remember finding hints on the site to help them tweak things)
#
Poorchop
yeah I need to look things up for html sometimes but far less often than with markdown
#
jacky
semantics help out in a markup language
#
barnabywalters
yeah, there’s so much screen space available on desktop content authoring UIs, why not use some of it for a toggleable syntax reference
#
jacky
who knew?
#
Poorchop
I also like having fine control over every tag
#
[schmarty]
"Why (not) markdown?" discussions tend to stir up strong opinions 😂
#
[manton]
[schmarty] Oh, gotcha. Yeah, I basically have a hardcoded list of things that I shouldn’t publish until I have the compete site ready to go. After I run Hugo, I actually rsync the HTML to another server, and I can control what is included before that kicks off.
#
Poorchop
not in my experience - I think that I'm the only person alive who strongly prefers html over markdown and actually enjoys writing html
#
[schmarty]
manton: nice!! You are giving me confidence I could figure this out for my own site. A danger to my free time! 😂
#
Poorchop
I think that if this was 1995 and I didn't have a tricked out editor with autocompletion and auto-closing tags, I might slightly prefer markdown but with modern editors, html is a pleasure to write
#
[schmarty]
Poorchop 😂
#
Poorchop
that list is too short
#
[schmarty]
I tend to prefer markdown because I work with a lot of different editors and tools. I can't think of a single Micropub client with HTML highlighting or shortcuts
#
Poorchop
I'm using dokuwiki now which has its own syntax that is vastly different but the good thing is that it has buttons so that I don't need to commit anything to memory
#
Poorchop
not sure what that last sentence means
#
[schmarty]
quill's Editor is great but is much more like a Medium-style minimalist near-wysiwyg that outputs HTML
#
Poorchop
I'm not familiar with micropub
#
jacky
what is micropub
#
Loqi
Micropub is an open API standard (W3C Recommendation) for creating, editing, and deleting posts on websites, like on your own domain, supported by numerous third-party clients, CMSs, and social readers https://indieweb.org/Micropub
[benatwork] joined the channel
#
barnabywalters
technically my note posting UI is a micropub authoring interface with HTML syntax highlighting https://waterpigs.co.uk/notes/new/
#
barnabywalters
although I’m not sure anyone’s ever used it for posting ot a micropub endpoint, and it may well be broken
#
[schmarty]
barnabywalters++ sweet!
#
Loqi
barnabywalters has 1 karma in this channel over the last year (2 in all channels)
[KevinMarks] joined the channel
#
[KevinMarks]
you have to flip some config in Hugo, but you can get it to pass html through
#
[schmarty]
I'd be curious to see the learning curves on HTML vs markdown for someone new to both
#
jacky
granted, I can see markdown being easier to "learn" but HTML being easier to adjust and debug
#
[schmarty]
Like markdown is a handful of weird punctuation. HTML has multiple syntax concepts and a vocabulary.
#
[tantek]
[schmarty] I'd like to see those learning curves along with an X axis that beyond time actually has features.
#
barnabywalters
html has confusing things like <a href> vs <img src> which markdown avoids, at the cost of having to remember which way around the []() go
#
[tantek]
speaking from experience with both, href vs src is easier to remember than []()
#
[tantek]
also href and src are different. linking != transclusion
#
[tantek]
that's an important distinction based on which effect you want
#
[schmarty]
tantek: i think context matters too much to map markdown vs html features learned over time without also considering what tools are used to support authoring
#
aaronpk
oh that's why it's <iframe src> too huh
#
[tantek]
clever, right aaronpk? 😉
#
barnabywalters
[tantek]: sure, but the element determines that. if we’re talking about learnign experience for people new to both, I think they’re more likely to see both as being a “place to put a URL” rather than “linking vs transclusion”
#
aaronpk
almost like someone thought about this
#
[tantek]
and back in the day, embed src
#
[KevinMarks]
html has fewer syntax constructs than markdown, as it uses words rather then punctuation to distinguish things
#
[tantek]
except then the folks at W3C messed up with object and used 'data=' 🤦‍♂️
#
[tantek]
it really should have been object src
#
[schmarty]
Just make sure you don't use the word transclusion when teaching someone HTML for the first time 😂
#
aaronpk
[schmarty]++
#
Loqi
[schmarty] has 10 karma in this channel over the last year (58 in all channels)
#
[tantek]
yes yes [schmarty] this is the dev channel 🙄
#
[tantek]
when teaching it's do you want to link to it or embed it in place?
#
[tantek]
people get that
#
[schmarty]
I think it's a fair call out in the context of teaching folks authoring languages 😄
#
barnabywalters
sure, but they simultaneously have to learn that <a> links and <img> transcludes
#
barnabywalters
the attributes being different is just another layer
#
barnabywalters
e.g. why couldn’t it be <a uri=""> and <img uri="">
#
jacky
good question
#
barnabywalters
I suppose the hypothetical is: if you could design HTML from scratch, would you still choose to use different attributes for linking and transclusion
#
[KevinMarks]
theres a post from mark pilgrim about how img src got decided, and what Timbl wanted instead
#
[KevinMarks]
<a name=fig1 href="fghjkdfghj" REL="EMBED, PRESENT">Figure </a>
#
barnabywalters
huh, the <icon> proposal is interesting, I’d not seen that before
#
barnabywalters
good grief, that’s hideous
#
aaronpk
wow the idea of built-in images or text equivalents is oddly similar to emoji
#
barnabywalters
yep aaronpk, right down to “I somewhat prefer ICON since it imlies that the IMAGE should be smallish”
#
barnabywalters
it’s clearly intended for small, inline graphics rather than large images
#
barnabywalters
<IMG HREF="http://nsa.gov/pub/sounds/gorby.au" CONTENT-TYPE=audio/basic> is pretty amusing too
#
barnabywalters
it’s a proto-<audio>
#
aaronpk
that's quite the thread
#
barnabywalters
yeah it’s some fascinating web history
#
barnabywalters
[KevinMarks]++
#
Loqi
[KevinMarks] has 13 karma in this channel over the last year (59 in all channels)
#
[manton]
Great find. I had never read that.
#
[tantek]
interestingly, having different attributes that are closer to the actual piece of the data (the URL) makes it easier to teach & remember, even though you might think a generic "uri" attribute would be "simpler"
#
barnabywalters
“closer to the actual piece of the data” -> what does that mean
#
[tantek]
and allowed re-using href in the <link> tag for a different "link" semantic/function than <a href>
#
[tantek]
barnabywalters, there's a whole thing on metadata (which tags & attributes kind of are) and distance from actual data
#
[tantek]
(Sam Ruby’s postulate: The accuracy of metadata is inversely proportional to the square of the distance between the data and the metadata.)
#
barnabywalters
I’m sure there is, I’m just skeptical about how much of it is based on decisions made somewhat arbitrarily 20 years ago, when “<a name=fig1 href="fghjkdfghj" REL="EMBED, PRESENT">Figure </a>” was also being considered
#
barnabywalters
and that previous statement still seems pretty incoherent to me
#
[tantek]
you can look it up for a bunch of different contexts around it.
#
[tantek]
unfortunately search engines can't find the original in HTML on Ruby's blog, only a .atom file, which is too unfriendly of an experience to link to
#
[tantek]
yeah, rel="embed" could have worked
#
[tantek]
rel="present" starts to get into things that since then we realized worked better in a different (presentational) layer, CSS
#
jacky
I keep looking up more SSGs and now I see this https://www.npmjs.com/package/microsite
#
barnabywalters
CSS isn’t what causes an <img> element to display an image, though
#
barnabywalters
and if rel=embed, present is required to embed an image, what would rel=embed or rel=present by themselves do?
#
[tantek]
barnabywalters, you may want to take a closer look at the 'content' property in CSS 😄
#
[tantek]
what causes an image to display has been moved to CSS
#
barnabywalters
ah, that’s how it works internally now? interesting
#
[tantek]
img src is now "just" handled via default style rules
#
barnabywalters
from an HTML authors POV that’s an implementation detail, though
#
[tantek]
yes it's been a loooooong project to get default presentation special rules out of HTML and into CSS
#
jacky
RIP <font>
#
jacky
we barely knew ya
#
[schmarty]
jacky: still in use if you write HTML emails 😒 😭
#
barnabywalters
the <marquee> element was the first HTML I ever wrote
#
barnabywalters
fond memories
#
barnabywalters
back when I didn’t have to worry about linking vs transclusion, only small details like exactly where the / goes in the closing tag
#
[tantek]
barnabywalters yeah, there's a bunch of us that thing the closing tag should have been universal, </> that is
minoru_shiraeesh joined the channel
#
[tantek]
think* the
#
[schmarty]
dang now i am really curious how many folks write what kind of content into micropub client's like quill's note interface.
#
[schmarty]
*clients
#
jacky
[schmarty]: right
#
barnabywalters
[tantek]: I guess it didn’t gel well with elements where the closing tag is optional?
#
jacky
there's so many little things like that I think could help us answer some questions around what to have in a client
#
[tantek]
barnabywalters it would have worked fine for those with the trailing /> e.g. <img ... />
#
barnabywalters
it’s an interesting idea, reminiscent of universal } or end for defining blocks in programming languages
#
[tantek]
right, plenty of prior art
#
[tantek]
SGML was kind of a messy starting point, and that's what Tim just happened to use / know of for a starting point for HTML
#
barnabywalters
when I was first learning HTML, I’m pretty sure I tried putting attributes on closing tags to see what would happen
#
barnabywalters
kinda like you can use do while {} or do {} while in some programming languages, and they mean different things
#
barnabywalters
doesn’t really translate to markup though, of course
#
[tantek]
well, it can, you just don't want to go down that (X)path 😉
#
barnabywalters
[schmarty]:
#
barnabywalters
[schmarty]: re what people type into micropub clients, I’m not up to date on the current status, but back when I was working on micropub a little bit, one the problems was figuring out how to match up authoring UIs with what format the micropub server is expecting
#
[schmarty]
barnabywalters: for sure! i think that is one of the main reasons a lot of micropub clients often just have plain text content areas.
#
barnabywalters
as far as I remember, my conclusion was either to send pure plain text (i.e. not assumed to be interpreted as markdown) or HTML
#
barnabywalters
which correspond to the p- and e- mf2 property types
#
[schmarty]
ahh, very interesting to try and guess what the resulting HTML's mf2 prefix would be!!
#
barnabywalters
or to be able to send both, and the server can pick which it wants
#
barnabywalters
but if a client offered a “rich” authoring UI, and the micropub endpoint only accepted the plaintext version, then there’s mismatched expectations and wasted effort on the part of the user
#
[schmarty]
i am trying to think of a client that sends both
#
barnabywalters
so there probably needs to be some way of a micropub endpoint advertising what formats it accepts, if that isn’t already something which was developed while I wasn’t looking
#
[schmarty]
i think micropublish.net, when editing a post, will prefer the html version if your micropub endpoint returns both.
#
barnabywalters
another approach would be for a micropub endpoint to offer a “preview” URL, which accepts micropub requests and just renders how they’ll look
[Ana_Rodrigues] joined the channel
#
[schmarty]
barnabywalters: agreed that without some way to coordinate this becomes a very messy problem for clients to try and tackle.
#
barnabywalters
which authoring UIs could then use for live previews
#
barnabywalters
well it looks like the standard already handles explicit HTML content https://www.w3.org/TR/micropub/#new-article-with-html
#
[schmarty]
with the JSON encoding, yep
#
barnabywalters
it’s a pity that nested objects don’t reliably work in the form-encoded encoding
#
[tantek]
It's the nesting that gets you (also in Markdown)
#
aaronpk
it was just never really defined in form-encoding, so you end up with different frameworks interpreting things slightly differenttly. if everyone had treated PHP's as the defacto standard things would be mostly fine
#
barnabywalters
does anyone know exactly why nested form-encoded objects don’t work everywhere? you can definitely use them in PHP to a certain extent
#
barnabywalters
ah okay thanks aaronpk
#
[tantek]
do they work consistently across browsers?
#
aaronpk
PHP arbitrarily decided that [] would be used for arrays and objects
#
aaronpk
it's a server thing not a browser thing
#
[tantek]
if so, then file a pull request to WHATWG HTML 😄
#
aaronpk
the browser treats the value of the form name attribute as a string
#
barnabywalters
in theory the [] notation could work everywhere
#
aaronpk
it definitely could, but currently does not
#
barnabywalters
it’s just a question of parsing it if your framework/environment doesn’t do it for you
#
aaronpk
oh another difference, with fewer excuses, is that technically the spec says attributes can be repeated, but in practice some server frameworks use only the last value
#
barnabywalters
I mean, JSON responses aren’t automatically parsed by every framework either
#
aaronpk
right but JSON is well defined and every framework has a way to grab the whole POST body and then you throw it at a JSON parser
#
aaronpk
e.g. `foo=1&foo=2` is allowed, but some servers will expose that only as `foo=2`, others will give you an array `foo = [1,2]`
#
barnabywalters
yeah, it definitely makes sense to use it in this case
#
barnabywalters
it’s just frustrating how close we came to not needing it
#
barnabywalters
and now have to support two parallel encodings :(
#
aaronpk
the other limitations of the form-encoding syntax vs json aren't really important in the end
#
aaronpk
(form-encoding treats all values as strings, JSON gives you strings and numbers for example)
#
jacky
and tbh that can be massaged by the language
#
jacky
(Rust has this JSON to structure marshalling thing)
#
[schmarty]
the distinction can be important if you're building a micropub client
#
jacky
tbh I've just considered it to be HTML only and send over JSON
#
[schmarty]
like the "principle of least power" suggests to me i should try to make things work form-encoded until my client's feature-set is somehow outside what form-encoding supports.
#
[schmarty]
but as a client author how do i know when to make the jump? do i advertise "your endpoint must support Micropub JSON requests"? do i make you check a box to enable the JSON-requiring features? etc.
#
jacky
you're touching on something that I kind of want more defined in Micropub via q=config
#
[schmarty]
seems like a good spot for it.
#
barnabywalters
AFAIK an endpoint must support both encodings in order to be compliant with the spec, no?
#
jacky
IIRC I can't remember
#
aaronpk
the way I've done it is I create a sort of fallback representation of the post that can work without the fancy objects
#
aaronpk
for example ownyourswarm
#
aaronpk
if it's in form post mode, it makes a plaintext version of the checkin post
#
aaronpk
and in json mode it will send the whole checkin object
#
[schmarty]
aaronpk: how does a user choose whether they want form or json mode? (and more importantly: how _should_ they? why would someone want to know this??)
#
aaronpk
I wrote this on the dashboard page: "If your software doesn't support checkins natively, you can use the "Simple" option to have it send a plaintext version of the checkins, which will appear on your site like regular notes."
#
barnabywalters
I don’t see a “MUST” anywhere, but this section doesn’t say anything about JSON support being optional https://www.w3.org/TR/micropub/#json-syntax
#
aaronpk
and you can choose which mode
#
aaronpk
it seems to have been working fine for people. generally they understand that if things look broken they try the other option
#
barnabywalters
aaronpk: what do you think of my idea above for a discoverable micropub preview endpoint?
#
aaronpk
wait i missed that
#
barnabywalters
tbh there’s not much more too it than that
#
barnabywalters
an optional, discoverable endpoint which accepts arbitrary micropub requests and renders what they would result in
#
aaronpk
yeah that'd be cool. definitely would be a trick in certain backends, but would be useful
#
aaronpk
i'd probably do it as another flag in the micropub request to the same endpoint, kind of like the current draft status proposal
#
barnabywalters
it would route around a lot of client/server mismatch problems, as exactly how the server is interpreting what the client sends it would be immediately visible
#
[schmarty]
barnabywalters: grantcodes has a neat alternate approach to that, for editing at least https://github.com/grantcodes/postrchild-extension
#
Loqi
[grantcodes] postrchild-extension: An inline editor extension for your indieweb website
#
[schmarty]
live preview by modifying the microformats2-annotated HTML already in the page!
#
barnabywalters
that’s really cool! it’s solving a bit of a different problem though
#
barnabywalters
if you’re using your own micropub client and server then you have some implicit knowledge about how their capabilities and formats interact
#
barnabywalters
not so if you’re using a 3rd party client
#
[schmarty]
that client runs in your browser so it works on my site just as well as it works on grantcodes'
alex11, [aciccarello], [snarfed] and jamietanna joined the channel
#
jamietanna
[schmarty] I'm still waiting for Hugo's date-based pagination to be supported (I may also look at raising a PR) https://github.com/gohugoio/hugo/issues/6992
#
Loqi
[jamietanna] #6992 Add date based pagination
#
jamietanna
I'm also quite tempted with the pre-render side of things, maybe getting my Micropub server to publish a file to S3 before it rebuilds? Or actually I could do it as a Lambda@Edge maybe - if there's a miss on a resource, check q=source, if it's there, show some minimal HTML?
#
[aciccarello]
Not the same as date based, but it looks like 11ty supports reverse order pagination which would help avoid rebuilds
#
[aciccarello]
what is pagination?
#
Loqi
pagination is a UI pattern for navigation across (typically chronologically) sequential pages that show one or more posts such as permalink post pages, archives, search results, and lists of tagged posts https://indieweb.org/pagination
#
barnabywalters
PHP devs: when passing a complex configuration value into a class or function, do you prefer having a straightforward array, or a configuration object with better support for type hints, auto documentation, intellisense etc?
#
barnabywalters
been a while since I wrote any PHP intended for others to use
#
[aciccarello]
pagination << [https://www.11ty.dev/docs/pagination/#reverse-the-data 11ty supports reverse order pagination for permalinks]
#
Loqi
ok, I added "[https://www.11ty.dev/docs/pagination/#reverse-the-data 11ty supports reverse order pagination for permalinks]" to the "See Also" section of /pagination https://indieweb.org/wiki/index.php?diff=75467&oldid=55035
#
barnabywalters
I previously tended towards simple arrays, but recent delving into rust, and exposure to just how great intellisense and automatic documentation can be is swaying me toward config objects…
#
barnabywalters
aaronpk: am I correct in understanding that a micropub endpoint doesn’t need to know how to give out access tokens, or care where they came from, and only has to know how to verify them?
#
aaronpk
correct
#
aaronpk
in oauth terms it is the "resource server"
Poorchop left the channel
#
barnabywalters
and when it verifies an access token, it gets information about who the user is, right? so one micropub endpoint could potentially be used for many different users?
#
aaronpk
not exactly
#
aaronpk
like in oauth, there isn't a defined format for access tokens
#
aaronpk
so the request will contain just an access token which might be a string like "JKXHCGKJHSFSDKJHSDG"
#
aaronpk
the easiest way to do multi-and-arbitrary-user micropub endpoints is to give every user a special endpoint when they set up the service so that you know how to verify tokens for them
#
aaronpk
that's what i did with webmention.io for webmention endpoints, and Aperture for microsub endpoints
#
barnabywalters
ah true, because it gets an access token, but it has to know exactly *where* to verify it, which depends on the user
#
aaronpk
multi-user micropub endpoints like micro.blog are easy because micro.blog also issues those tokens
#
barnabywalters
I’m starting work on a PHP micropub adapter/frontend, and ideally want to avoid coupling it tightly to a particular auth implementation
#
aaronpk
gotcha. the most generic way to handle that is for the micropub endpoint to use this to verify access tokens https://indieauth.spec.indieweb.org/#access-token-verification
#
aaronpk
but it has to know the token endpoint before it can go make that request
#
barnabywalters
okay, I think I can avoid hard-coding even that
#
barnabywalters
basically my idea is to write only the front-end which handles and dispatches micropub endpoints, and the library consumer passes in a table of functions which get called depending on what the current micropub request is doing
#
barnabywalters
so I can just have one which is “verify token”, and the user writes whatever they need there
#
aaronpk
gotcha
#
barnabywalters
the idea is to make something which handles all the gnarly format and encoding stuff, and makes it super easy to add micropub support to existing applications
#
barnabywalters
(such as taproot, which was built before micropub existed and is not really structured around it)
#
jacky
oooh interesting
#
barnabywalters
it should allow for some fun stuff like the endpoint library using reflection to auto-detect what capabilities it has based on which callback methods are implemented
#
jacky
heh that would be nice
#
jacky
I'm still trying to figure out how to do managed hosting from 'scratch' lol
lon3fr1gat3 joined the channel
#
lon3fr1gat3
hello?