#dev 2021-01-15

2021-01-15 UTC
#
@jwz
@Foone This is why it is right and proper to write your style tags as <STYLE TYPE="text/css"><!-- ... --></STYLE> and your script tags as <SCRIPT TYPE="text/javascript"><!-- ... //--></SCRIPT> which absolutely nobody does any more.
(twitter.com/_/status/1349868940688719875)
deltab, jeremycherfas, deathrow1, mitchell, willnorris, j605, lahacker, cjav_dev, oodani, jimpick, Kongaloosh, shakeel, Salt[m], nekr0z, [schmarty], [tantek], [Raphael_Luckom], KartikPrabhu, djmoch_, vilhalmer, treora, [tantek]1, [schmarty]1, jjuran, mayakate[m], drhitchcock[m], BudaDude[m], smacko[m], astrojl_matrix, malaclyps_, ciccarellome[m], [chrisaldrich], fredcy_, jamietanna[m], khimaros[m], JackyAlcin[m], antonio[m] and [fluffy] joined the channel
#
[chrisaldrich]
On the SSG front, I see people complaining about build times with what I would presume to be sites with a few hundred or maybe a thousand posts. I'm reticent to even look at them with a site that has 27,000+ posts.
#
[chrisaldrich]
I know that [jgmac1106] has been having some issues with Known lately that is causing his time to post to be about 7 minutes and he's thinking of giving up on it for that reason, so I can only imagine how frustrating it would be to a user taking several minutes to rebuild an entire site to add a note with 280ish characters.
#
aaronpk
Wait, how does it take 7 minutes to add a post to Known?
#
Ruxton
that's nuts.. Known shldn't take that long
#
GWG
My POSSE sometimes has a delay on it, but not my posting
[KevinMarks] joined the channel
#
[KevinMarks]
maybe I should test ssg's with my tweet export
#
[Raphael_Luckom]
would Known be caching? 7 minutes sounds more like a cache time than a render time
[tantek] and oodani joined the channel
#
[tantek]
maybe something to do with a database issue
[tw2113_Slack_] joined the channel
#
[tw2113_Slack_]
i need to either reconsider or reinvest effort into Fitbit data pulling. Not sure yet how I feel about the Google acquisition
#
[tw2113_Slack_]
but i can be swayed away if the new device company has decent API
alex11 joined the channel
#
jacky
[tw2113_Slack_]: I've begun looking at Garmin (they have some good trackers at a good price)
#
aaronpk
My current Fitbit battery has started to decay and I'm not sure I'm willing to buy a new Fitbit
#
[tw2113_Slack_]
i bought a new one last fall so i'm still doing good at the moment, but i'm eying alternatives
KartikPrabhu joined the channel
#
@kimihito_
“Webmentionを表示するようにした - コトリ式” https://htn.to/2TbqSqE3Xp
(twitter.com/_/status/1349957458207285249)
jacky, hoschi, jjuran, [chrisaldrich], swentel and nickodd joined the channel
KartikPrabhu and hoschi joined the channel
#
robindrake
ok I have the @me tags to mastadon and mewe, but what other rel links do I need to add?
#
robindrake
or is this question better asked in #indieweb?
[Murray] joined the channel
#
[Murray]
A bit late, but on the SSG front: Gatsby's incremental builds are _interesting_, they sort of work outside of their own Cloud structure (Netlify, for example, also supports them) and they shaved about 30% off my build time, but no where near as much as I'd hoped/expected. Eleventy doesn't support it natively, but I've seen a few people manage to get it functionally working themselves, particularly with webmentions (so it caches incoming
#
[Murray]
people mean by "SSG" that it doesn't count any more 😉
#
[Murray]
webmentions and just rebuilds the relevant page/pages). And then there's Next's route, which could be argued to no longer be an SSG 😄 Effectively, you can set Next up to fully server-side render pages, but then it will cache a static page for a certain time. The first user therefore gets SSR, but if someone else visits that page they get SSG (effectively). That's been super useful for us at my work, but it's probably so far away from what
#
[Murray]
though if someone ever does release true incremental builds on an SSG I think it would get me to convert my site immediately. Watching 11ty very closely for that 😄
#
@nicklewis
↩️ I set up something similar two days ago and it works a treat. Handy if I've not updated my site for a few days but i.e webmentions are being received, I know they'll be reciprocated each day at least
(twitter.com/_/status/1350025711126532103)
#
robindrake
Is my question too simple?
#
sknebel
it's not really "need to" - if you want to link to your profile somewhere else from your site, you can add rel=me to it. unless you want to use something that insists on you having something specific linked up, there is no "need" to do anything else or more
#
robindrake
ok, thank you sknebel
#
robindrake
I realize all this is covered in the wiki, but I get lost with all the links to links to links
#
sknebel
heh, yeah, that happens :D
gxt, hoschi, schmudde, petermolnar, [schmarty], [KevinMarks], jolvera_ and [Raphael_Luckom] joined the channel
#
[Raphael_Luckom]
Thanks for those observations!
#
[Raphael_Luckom]
sorry, meant to be replying to Murray, wasn't all the way scrolled down
#
[Raphael_Luckom]
I do think that my incremental build system might _technically_ be a "static site generator" because it renders md to html. But it doesn't fulfill the same value proposition as hugo, so I agree with Murray that it might be useful to think of some of these infrastructure-required things as _not the same thing_.
[tantek] joined the channel
#
aaronpk
wordpress can do SSR on first view then serve a static page after and i'm really not sure i'd call that a static site generator :D
jamietanna joined the channel
#
[Raphael_Luckom]
If you could use wordpress at the cli to generate an all-static version of a site, would it count then?
hoschi joined the channel
#
jamietanna
So a run from a few minutes ago too 3m8s to build the site on Netlify (68s was Hugo) to generate ~25000 files and then a further 4m55s to deploy it live
#
aaronpk
if no code has to run on the server then yes i'd count that
#
aaronpk
or rather, no code has to run in response to web requests
#
[Raphael_Luckom]
I really like that as the differentiator: does code run in response to web requests (defining a file-server level of interaction as "no code running")
#
jacky
right
#
[Raphael_Luckom]
One of my priorities is to define the services I depend on carefully. I really like the way AWS lets me organize a system and separate concerns, but I don't like being in bed with amazon-the-company. I'd like to be able to say "this is what I think static-site hosting looks like--it's an object store, plus eventing, plus routing, plus optionally a cache. And then be able to move pieces of that off AWS as better providers are available.
#
[Raphael_Luckom]
I think there are already a couple of places where I could maybe use Backblaze instead.
nickodd joined the channel
#
petermolnar
some of these are the reasons why I ended up writing my own script (I'm not going to call it a static generator, that would be an overstatement): I can run it locally, do an rsync afterwards, plus it makes html with relative-only links inside the domain, so it even works offline, locally.
#
petermolnar
aaronpk: I used to have a cache plugin for WP that had the option to cache forever in memcache - I guess that's sort of a static generator...
#
aaronpk
that's the thing i was trying to differentiate. caching vs actually generating static files
#
[Raphael_Luckom]
It feels like part of the reason there can be so much debate around ssgs is convergent evolution. People with vastly different goals and use cases pass through this zone where their code could be described as "an ssg", but everyone in that "built an ssg" space is headed in a different direction. That's plurality!
swentel, hoschi, schmudde, [tw2113_Slack_] and [chrisaldrich] joined the channel
#
GWG
Fun question...for me...
#
GWG
What urls outside of a standard date based URL scheme do you have on your site?
#
GWG
For example, custom archives, pages, etc
#
[Raphael_Luckom]
I use this file as the central source of truth for the types of URLs my site will build: https://github.com/RLuckom/raphaelluckom.com/blob/main/terraform/sites/raphaelluckom.com/site_description.json
#
GWG
I've been adding new archive pages to my site and was looking for new ideas
#
GWG
For example, all photos posted on my site and all photo posts on my site are two different ones
btrem joined the channel
#
btrem
shoesNsocks: do you have any recommendations for how to manage urls/permalinks with 11ty? Something not on 11ty.dev, as I've been through them, and still can't make anything work.
#
shoesNsocks
@btrem what's your goal? I don't think I'm doing anything much different that the starter -- blog posts are .md files in a folder structure like "2021/01/15/slug.md" and I end up with a post at "rich-text.net/2021/01/15/slug/index.html." But maybe I'm not sure what you're asking.
#
btrem
Ah, I'm going for a different url structure. I want e.g. example.com/articles/2020/foo  and  example.com/articles/2021/bar
#
btrem
One of the truly frustrating things about virtually every cms/ssg/etc. is the inability to offer flexibility in creating a url scheme. Even when the software docs promise lots of just such flexibility.  :(
[KevinMarks] joined the channel
#
shoesNsocks
Would setting the `permalink` key in frontmatter help? Or maybe you're doing things programatically, lots of articles already written, and you don't want to go back and manually "touch" lots of existing files?
#
btrem
Only a few articles. But I hate the idea of adding a `permalink` key to each file. I'm bound to mess something up at some point. I was hoping to set `permalink` in .json files in the /posts/ and /articles/ directories and let it do its thing. But it appears to be unworkable. Especially if I use mixed formats, which I am: nunjucks and .md.
#
btrem
Quite a shame, as the whole point of learning 11ty was to have a tool to manage urls for me. If it can't do that, its usefulness to me is limited.
#
shoesNsocks
@btrem random Q: are your current filenames also the slugs you'd like to see in the URL?
#
shoesNsocks
(if slug is the right term...)
#
btrem
Partly. I want the url to be based on both date and slug. /articles/2020/12-pets  for an article about pets written last month; and /articles/2021/01-garden for an article written about gardening this month; etc.
#
btrem
Thing is, if the extension is different, 11ty uses a different processor, so the code to create the permalink fails spectacularly in some cases.
#
shoesNsocks
@btrem ah, yeah, that's a level of complexity I haven't run into...
#
btrem
Ok, thanks for the replies. I think I either need to suck it up and create urls "by hand" as they say (though when they say it, they never really mean "by hand"). Or try out a different ssg, which I really don't want to do. Especially since I might go through the work of learning e.g. Jekyll only to run into the same inflexibility.
#
shoesNsocks
@btrem, in your preferred URL scheme, where do the year, month, and tag/category/slug (in your examples above, "pets" and "garden"), come from? I am fooling with a sample repo and I think I can make it work if those 3 items -- year, month, and tag -- come from frontmatter data.
#
shoesNsocks
(but i'm still writing the frontmatter by hand, which might still not be what you're looking for)
#
btrem
No, I will have frontmatter in each file. I was hoping to only put in a date, a title (or maybe slug), and tags. And let 11ty create consistent urls from that. Year and month come from date; "pets" and "garden" would either be {{title | slug}} or from a dedicated mySlug item. The biggest obstacle is parsing page.date consistently. Nunjucks
#
btrem
templates have one way to parse them, .md have a different way. Even when I tell 11ty to use .njk to parse .md. It might be that I'm just not pressing the right button so to speak. So far, I haven't come across a guide on the web that tells me which button to press, and how hard.  ;-)
btrem and hoschi joined the channel; nickodd left the channel
#
btrem
Utterly maddening trying to decipher 11ty docs.
#
btrem
https://www.11ty.dev/docs/languages/javascript/#function  How do I incorporate that into the config file? Bloody hieroglyphics!
#
[Raphael_Luckom]
it's true that lots of systems have docs that aren't very clear, especially when you start using them. One thing that can help is to try to have your own code somewhere like github so you can point to the specific issues you're having. I don't know much about 11ty, but I'd be happy to spend a little while trying to work through the issue if you want.
#
[Raphael_Luckom]
Is there a word for "the non-state-holding parts of a system"? I'm thinking "plumbing" but there might be a better one
#
btrem
Hmm. Putting code on github is a really good idea.
#
btrem
I mean, I already do that, but not for the reason you gave.
#
[Raphael_Luckom]
whenever I get stuck, I start trying to put together enough information for someone to understand what I'm trying to do and how it's breaking. 75% of the time I get the answer just by going through that exercise, and 5% of the time I actually succeed in getting help. the other 20% is failure.
#
shoesNsocks
@btrem I have been fooling around and maybe figured out an eleventy-config function that returns your preferred URL scheme, in .liquid, .md, and .njk files
#
shoesNsocks
(but yeah seeing sample code on github or similar would help!)
#
btrem
[Raphael_Luckom]: I often figure out the problem while writing an email to a list I subscribe to. I suppose that's the rubber duck phenomenon.
#
btrem
Well bummer, it appears that codepen doesn't have a json box. Just html, css, and js. I suppose I can use js, but it thinks there's a syntax error.
#
btrem
I used the html box instead. Here's my articles.json file:
#
shoesNsocks
@btrem I may have misunderstood something along the way, but look at this https://github.com/shoesandsocks/url-test
#
shoesNsocks
ah, seems like we're both heading in a similar direction (I didn't have the IF statement in permalink)
#
btrem
Your idea uses the current date to get year and month. In other words, every time I rebuild the site, it will generate a new, possibly different, permalink for each page.
#
btrem
I guess the question is, how do I get the template's frontpage date (aka page.date) into that function?
#
shoesNsocks
no, it uses the `page.date`
#
btrem
Oh, I'll look again.
#
shoesNsocks
I think I got it right? LOL
#
btrem
Ah yes, I can work with that, I think. I'll futz around with it and let you know how I make out.
#
shoesNsocks
I have 4 sample files in `/articles`, they each have a `mySlug` and a `date`. The permalink "thing" in the JSON file has access to each file's page.date. At least that how it looks here, I might be misunderstanding soemthing
#
shoesNsocks
(my JS in the config file is definitely hobbyist-level. probably a clever way to be more concise)
#
btrem
Actually, your code to pad the month is better than what I usually do. I go the route if month < 10 month ="0" + month. Which is rather inelegant.  :-o
hoschi-it, hoschi, enpo, sknebel, malaclyps_, GWG, nekr0z, [tantek], astrojl_matrix and antonio[m] joined the channel
#
btrem
shoesNsocks++
#
Loqi
shoesNsocks has 2 karma over the last year
#
btrem
The date function works. Thanks.
#
shoesNsocks
good deal!
#
btrem
I have a njk expression in my permalink {{ slug if slug else title | slug }} so if there's an explicit slug, it uses that. If not, it makes a slug out of the title. It works in e.g. /posts/foo.njk but it does not work in /posts/bar.md
#
btrem
I mention this because that explains the problems I had earlier. A nunjucks filter does not work with md files.
#
btrem
Even if you tell 11ty to process .md files with the nunjucks processor with the statement markdownTemplateEngine: "njk";