Live data from Hacker News

Blog with Markdown and Git, and degrade gracefully through time

brandur.org

171–180 of 182 posts

Re: Blog with Markdown and Git, and degrade gracefully through time

#172
post #117

Earlier quoted context omitted.

Something similar happened to me when I was using static site generators. In fact one that I was really enjoying even switched programming languages between 1.x and 2.0. Since that time I look for the people and community behind the project, and try to find signs of stability and long-term care. After that I look at open formats rather than open and flexible architecture-chains. For example, I'd rather use my LibreOf…

> I'd rather use my LibreOffice HTML template and simple PHP controller Could you tell me more about this? I've had a similar idea but the HTML that LibreOffice generates is very gross

It's a simple injection controller for adding links and markup. Very rough. It doesn't do much about the existing HTML, which I felt was mostly workable, or workaround-able. :-) You can see some output here:

https://www.friendlyskies.net/fmk/

Re: Blog with Markdown and Git, and degrade gracefully through time

#173
post #4

This is pretty much how I do it. I built my SSG using Hakyll and host the resulting binary on my own Debian repo, that way I can write a post in any flavour of text that Pandoc supports (though I go with Markdown for simplicity) and within about 20 seconds my CI pipeline has built and pushed a new version of my site (using scp). Easily done by myself too but at least I know with the CI approach that I'm writing to gi…

How do you push and install a Debian package with scp?

Re: Blog with Markdown and Git, and degrade gracefully through time

#174

Earlier quoted context omitted.

Thanks for reading! Really appreciate it. It's been quite a journey and I honestly credit the tech stack with making it so easy to write.

What's your tech stack?

Jekyll + Gitlab for CI/CD

It's been great.

Re: Blog with Markdown and Git, and degrade gracefully through time

#175
post #77

Self Promotion: You can use GitJournal [0][1] to manage the blog posts from your mobile. It's just a convenient git + markdown client on mobile. I'd built this for managing notes, but it seems that many many people use it for their websites. (Including me) [0] https://gitjournal.io [1] https://github.com/GitJournal/GitJournal

Thanks for this tool, btw.

Re: Blog with Markdown and Git, and degrade gracefully through time

#176
post #4

This is pretty much how I do it. I built my SSG using Hakyll and host the resulting binary on my own Debian repo, that way I can write a post in any flavour of text that Pandoc supports (though I go with Markdown for simplicity) and within about 20 seconds my CI pipeline has built and pushed a new version of my site (using scp). Easily done by myself too but at least I know with the CI approach that I'm writing to gi…

How do you push and install a Debian package with scp?

After compiling the binary (with haskell-stack) I use fpm to package it up as a .deb (https://github.com/jordansissel/fpm).

I then scp the file into the pool directory on my server, and re-run a script that calls apt-ftparchive and regenerates the contents of the repo (https://manpages.debian.org/buster/apt-utils/apt-ftparchive....).

My web server hosts that directory with indexing enabled, but I don't use apache for it like most examples do. There's nothing special about it, it's just a directory tree built in a way that apt likes. (https://pkg.kamelasa.dev/). In fact, the entire configuration of the repo is visible there.

There's a step in the middle where I sign the packages with my GPG key, and the public key is available on Ubuntu's keyserver (http://keyserver.ubuntu.com/).

I don't need to run this workflow very often, as it'll take about 40 minutes to rebuild and push. But if I do update my SSG I know it'll end up in my debian repo with a version bump, so I'm happy.

On a second pipeline I can just do a simple 'add-apt-repository' and 'apt install'.

Re: Blog with Markdown and Git, and degrade gracefully through time

#177
post #36

Earlier quoted context omitted.

Yes, if you constantly update your installation, which is the exact opposite of what this blog post is about. Otherwise you run a pretty good risk of your installation being hijacked, overtaken by spam bots or similar after a few years.

Yep. I run a few WordPress sites and the amount of maintenance with them is crazy. The plugin model makes maintenance brutal too since it's all independent devs with different release cycles, testing practices, etc.

Same story with Jenkins, the plugin ecosystem is just ridiculous. If Linux distros did the same thing with packages, Linux would be broken literally all the time.

Re: Blog with Markdown and Git, and degrade gracefully through time

#178

Plug for Blot[1] which makes it trivial to have a directory of Markdown source files and supporting assets (images, mostly) for my blog[2]. [1]: https://blot.im/ [2]: https://paul.af/

See also Caddy web server:

Rendered: https://caddyserver.com/docs/caddyfile

Markdown: https://github.com/caddyserver/website/blob/master/src/docs/...

Unofficial How-To thread: https://caddy.community/t/markdown-support-in-v2/6984

Re: Blog with Markdown and Git, and degrade gracefully through time

#179

IMO the biggest barrier to blogging (and the cause of most blogs dying) is inconvenience, and minimizing that if the biggest advantage of Markdown + Git. If there's any inconvenience at all, it naturally drags on the process of writing, and writing takes enough time and focus that if there's any friction it's too easy to push things off to the next day. My co-author and I use Markdown and Git as the author suggests,…

Any suggestions for static site generators / where to host? I'm thinking about starting a new blog with Hugo / Digital Ocean. I have a popular Spark blog on Wordpress ( https://mungingdata.com/ ) and can relate to your sentiment that any inconvenience can hold up the writing process. Your post is motivating me to streamline my publishing process.

Gitlab and Github both have static site hosting options. Netlify works great as well.

We've gotten it to the point where we just push new pages via git and it all works. Anything more and you'll find yourself procrastinating ever so little at a time...

Re: Blog with Markdown and Git, and degrade gracefully through time

#180
post #72

Earlier quoted context omitted.

Following the philosophy of simple hosting + MD outlined in the OP then the WP equivalent would be something like a simple (official twenty*, or your own custom) WP theme with zero (or minimal amount of) plugins. Enable auto-updates on WP and you're done. The more plugins you use, the faster entropy kicks in without maintenance. With WP in general though I definitely agree.

Agreed, if you stick with the twenty* themes and keep it simple, you can get pretty far with very little maintenance. For simple sites, especially where we don't do comments, I've started using Simply Static though to just generate pre-rendered pages. All the benefits of static site builder with all the conveniences of a CMS.

I've had it on my TODO-list to try out that plugin, thanks for reminding me!

How many sites have you tested it on, have you had any issues? I'm gonna play around with it now but what I'm mostly concerned about now is how you manage the site if you point the web server to the static directory.

I made a prototype at one point where you have your actual WP site in a subdirectory, like example.com/wordpress, which is IP restricted (or behind http auth). Then you crawl that site with wget (or curl) to generate static HTML and to finish it off by search/replacing the HTML files (removing the /wordpress portion). Then you serve the static files to general users.

Post reply on HN