User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
Admin
Wyvern-shaped software developer and hobby vector artist. Also sometimes a fluffy werewolf alien creature (Areon).

Creator of the neofoxes, neocats and other emojis.
wvrnBox
Website
https://volpeon.ink/
Speaking German, English
Age 30s
Pronouns he / him
Backup Account @volpeon@goto.wyvern.rip
Bonus Content @areon@icy.wyvern.rip
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
Thing is, a later pipeline step accepting string | number can handle an output of just number. But I can't tell Typescript "this type can be anything as long as it also accepts number" in a way that generates a type error for the function argument of connect.
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
Getting the type programming right fried my brain in addition to the heat. neofox_googly_woozy

Most of it works with regular type errors, except for this one case. Would be nice if there was an inverse to
extends. Oh well, at least I made the message helpful
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
If you're wondering how this leads to Markdown files being turned into HTML with templates, the process is comprised of these steps:

Page<".md", string, {}> -> Page<".md", string, frontmatter data> -> Page<".html", string, frontmatter data>

Anything that becomes
Page<".html", string, ...> before the template hook in the pipeline will be processable by templates ingesting Page<".html", string, ...>.
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
I generalized the concept of templates to work with any page type. Most of the time they're going to ingest Page<".html", string, ...> as shown here, but you could have templates for anything
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
Oh, and this
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
Most people probably won't care if their SSG can tell them this, but I think it's neat
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
The typing is super easy to understand, right areonNAngel
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
I overhauled the API to avoid all the weird function chaining. It's less awkward now, and the reported input and output types are correct areonNCute
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
@yacha neofox_googly_woozy
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
This one is for Puni Bocchi the Bock neofox_googly_woozy
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
The only problem is pages whose Type is a union. I use Exclude to mutate the input and output types and it doesn't work reliably because of that. Page<".md" | ".mdx", ...> shouldn't be in the output
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
areonNHyper
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
Cancel the datacenter projects, my mom has resources to spare for 10 humanities neofox_googly_woozy
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
@catraxx neofox_googly_shocked
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
They're putting fiber cables in our street right as the big heatwave is coming. neofox_googly_shocked
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
Firefox on my mom's laptop did a funny and said website cache was taking up 17bn GB. neofox_googly_woozy Fixed itself after restarting Firefox
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
Soon it'll tell you what input formats it expects and what formats it outputs, along with the expected and returned metadata respectively. I love using types to do impressive stuff like this. areonNAngel
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
And here's a plugin to add a persistent cache which can be used by dependent plugins for stuff like storing resized and recompressed image variants
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
It was all worth it when adding support for new template formats is as easy as this areonNAngel
User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
3mo
I had to do some really arcane stuff with TypeScript's type system to make this work.