News for hackers. Stuff that matters.
Re:Start a Fucking Blog by azangru on Tuesday January 03, 2023 @09:43AM (#34231921)
So here's my question about static-site generators, such as the one that the linked site recommends.

They seem fine for lengthy prose. You probably aren't going to write that many long-form blogs anyway — in the vicinity of several hundreds, maybe. After many years. So that's fine.

But what I've discovered about my writing habits is that I mostly tend to write short notes, about the size of a Hacker News comment. And those can easily number in thousands after several years of writing.

So how well is a static site generator suited for this? Do I want to build thousands of pages every time I start the site locally? I probably don't. But I can't find a reasonable static-site generator that will only build the requested pages locally, and build everything when deployed.

It's probably also silly to pre-generate a static html page for every such short posted note.

What's the most appropriate solution for such a writing pattern? Bite the bullet and set up a Wordpress or a Mastodon instance? That's a bit depressing.

Re:Start a Fucking Blog by Brajeshwar on Tuesday January 03, 2023 @09:50AM (#34232021)
You don't need to run and build the site every time. Jekyll crawls to a halt on my website if I build it locally when I write. So, I just write in Obsidian, iAWriter, or Sublime Text. The articles are sometimes un-finished, to-be-edited. I push them and Github does the magic.

Now, replace Jekyll with any SSG and let a tool handle the build (Netlify, Vercel, CloudFlare Pages).

For your specific tweet/comment like post, I remember deploying quite a few instances of something called "P2" from WordPress for internal department updates, team updates etc.

WordPress P2: https://wordpress.org/themes/p2/

Re:Start a Fucking Blog by pflenker on Tuesday January 03, 2023 @09:55AM (#34232097)
I do the same with Jekyll. I have tweaked my theme so that it looks great even on very short posts without title or image, and it works fine.
Re:Start a Fucking Blog by scary-size on Tuesday January 03, 2023 @09:50AM (#34232026)
Got the same issue. Found those static site generators somewhat unwieldy to handle, especially for non-tech people. I worked on two different approaches:

* A desktop app for creating static blogs, local preview, generates assets, optional deploy directly to Vercel. [1]

* A cron job which reads the paragraphs of a Notion page. Currently only generates an Atom/RSS feed from each paragraph. Inspired by [2], currently no source available.

[1] https://www.project-daily.com

[2] https://brandur.org/atoms

Re:Start a Fucking Blog by underdeserver on Tuesday January 03, 2023 @09:49AM (#34232011)
Not sure it's that bad. Small, static text with minimal includes might be 300 bytes of overhead. What's the harm in having a few thousand of these?
Re:Start a Fucking Blog by turmeric_root on Tuesday January 03, 2023 @11:10AM (#34233283)
I have a single HTML file with notes like this on my site. it's not the prettiest but literally no one else is going to read it anyways.
Re:Start a Fucking Blog by mikojan on Tuesday January 03, 2023 @11:23AM (#34233493)
> So how well is a static site generator suited for this? Do I want to build thousands of pages every time I start the site locally?

Take a look at Astro[1]. Astro comes with a development server and it will not build a thing unless you want it to.

Also, in contrast to classic static site generators Astro relies on components instead of templates which reduces cognitive complexity dramatically (to me anyway).

[1]: https://astro.build/

Re:Start a Fucking Blog by azangru on Tuesday January 03, 2023 @04:31PM (#34238375)
Yeah, I've been eyeing Astro, and wondering whether I like it or Eleventy more. What worries me about Astro is that its internals must be very complex, since it's trying to support all the component frameworks and libraries out there. As a result, I heard some complaints about unaccountable problems with my favorite component library, Lit. I am also very surprised that the choice between SSG and SSR mode in Astro seems to be all-or-nothing, rather than a configuration that would allow SSG-ing some pages and SSR-ing others.

But yeah, its syntax, with an out-of-the-box support of typescript, looks more enticing than Eleventy's nunjucks or webc, or its serverless plugin. Good to know that Astro doesn't prerender all pages in dev mode either.

Re:Start a Fucking Blog by jjdeveloper on Thursday January 05, 2023 @06:51AM (#34258523)
They now have an experimental flag that allows some pages to be SSR and others SSG. So this is now possible
Re:Start a Fucking Blog by lucasdicioccio on Tuesday January 03, 2023 @01:07PM (#34235226)
The way I've done it for my own notes (in a custom-made static-blog generator) is to have a template dedicated to "notes" and some over-engineered pipeline for similarly small datasets [1].

[1] https://lucasdicioccio.github.io/dhall-section-demo.html