Live data from Hacker News

Rewriting my blog in Rust for fun and profit

jonashietala.se

71–80 of 116 posts

Re: Rewriting my blog in Rust for fun and profit

#71
post #62

Earlier quoted context omitted.

I plan on writing a static site generator soon myself. And I briefly wondered the same thing and realized that I could very easily answer that question: ruthlessly build whatever I personally need and not what others need. I don't usually follow that line of thinking, but the static site generator space is so full of so many great tools that I don't think there's really anything for me to contribute to it. Instead, I…

We think alike. I started out with Hugo because it's very popular and relatively easy to use. It has a bunch of features that I had to read about but didn't have a use for -- overhead. One of the most annoying aspects of working with hugo was the friction from idea to publishing it. I decided to go a completely different route and built https://prose.sh With prose all I have to do is to create a markdown file and the…

Nice! I have a Hugo site I’ve tweaked over the years, and my workflow is similar to yours. I create/edit an MD file, then run a shell command which pushes changes to Github, which triggers a redeploy.

How do you handle images? That’s my main annoyance / biggest hurdle when publishing. I have to take each image, resize it for web, put it in static folder, and reference that pathname in the MD file. Not a big deal, but would love an easier way. I suppose I could write a simple shell script that does all of the resizing and prints out a path back for me to use.

Re: Rewriting my blog in Rust for fun and profit

#72
post #62

Earlier quoted context omitted.

We think alike. I started out with Hugo because it's very popular and relatively easy to use. It has a bunch of features that I had to read about but didn't have a use for -- overhead. One of the most annoying aspects of working with hugo was the friction from idea to publishing it. I decided to go a completely different route and built https://prose.sh With prose all I have to do is to create a markdown file and the…

Nice! I have a Hugo site I’ve tweaked over the years, and my workflow is similar to yours. I create/edit an MD file, then run a shell command which pushes changes to Github, which triggers a redeploy. How do you handle images? That’s my main annoyance / biggest hurdle when publishing. I have to take each image, resize it for web, put it in static folder, and reference that pathname in the MD file. Not a big deal, but…

We are working on https://imgs.sh which will try to make optimizing for web automatic as well as making it easy to reference images from your blog.

Re: Rewriting my blog in Rust for fun and profit

#73

This is mindblowing synchronicity. I thought this article was one I had read this weekend for a second but checked the post date and saw it wasn't available yesterday. I'm working on trying to write a static site generator for my own personal site/blog in C++, been tinkering for a couple months. It started as a passion project in tribute to my dog that passed. GatsbyJS wasn't working (again) which is what my current…

I've found you don't actually need a templating system, you just need format-strings. Write your rendering logic with normal code that just spits out a string

Templating languages probably help with performance a bit when you're rendering at request-time, but for static stuff I don't really see much point

I've got a hand-rolled static site generator in JavaScript that just uses template strings. I only have around 30 pages, to be fair, but when I make a change it re-generates the whole site before I can even alt-tab and reload the page. I assume a C++ version could be much faster

Re: Rewriting my blog in Rust for fun and profit

#74

I'm seeing a few too many comments about static site generators rebuilding everything on a change. Have the tenets of Make (and the like) from over 40 years ago been forgotten? I guess maintaining a dependency graph just isn't a high priority feature for site generators.

Computers are fast, sites get updated infrequently, and compiling a static site is a lot less computational work than dealing with the utter *********** that is C++ templates.

Unless you're 'web-scale', it's complexity that doesn't solve any particular business need.

Re: Rewriting my blog in Rust for fun and profit

#75
post #7

I've been trying to make a cool static site generator numerous times. Well, yes, it actually is a quite fun thing to tinker with, but I've found myself struggling to decide on what do I want to see in the final app and what I do not; what features might be needed by other users and what features might be an overkill. So I ultimately went with Zola[1] and encourage you to try it too! Aaaand it is written in Rust, too.…

I plan on writing a static site generator soon myself. And I briefly wondered the same thing and realized that I could very easily answer that question: ruthlessly build whatever I personally need and not what others need. I don't usually follow that line of thinking, but the static site generator space is so full of so many great tools that I don't think there's really anything for me to contribute to it. Instead, I…

I've just started to take that approach (exactly what I need, no more, no less) with personal process automation, and it's really working for me.

I made a few attempts in the past at building more general-purpose tools that would cover my use cases, but I've never followed through on them. Too much of the work was in the bits that don't actually benifit me right now.

My new tool is simply called "Other Jeff". I write onto it what I need right now. Do I have a series of pull requests that need babysitting to get them over the line? Other Jeff learns to poll their status and notify me of important events along the way. If I want to store some state about what I'm working on right now, I need a database of some kind, right? Nope. Not any more. I hard-code it into `db.rs`, because it turns out there's almost nothing I need to persist that's too burdensome to update by hand.

So what I have in the end is a single Rust program that grows and shrinks depending on my needs at the time, accumulates reusable helpers if and when they actually make sense for _me_, and slowly learns to automate more of my daily distractions.

Re: Rewriting my blog in Rust for fun and profit

#76

Earlier quoted context omitted.

My needs are far simpler than that. I don't need state. I don't need dynamic content. I don't need ads. I don't need tracking. I don't need search. I just need a way to publish content and maybe an RSS feed. It doesn't even need to serve files. Everything is static. (I'm not saying fasterthanlime has all those things. Just saying what I don't need.) I can't even imagine I need a template system beyond something I can…

I plan on trying https://luapress.org/ one of the next weeks. Looks good at a first glance -- give it a quick check if you get a free hour, would be interested what you think of it.

I don't have a free hour unfortunately. And I know I'm not going to use that because I don't want to setup a Lua environment. Indeed, I have enough Lua experience to know that they break the language in big ways for what seems like every release. That's a liability. What happens when luapress stops getting regular maintenance and the version of Lua it uses is no longer packaged in my Linux distro? Oops. Ticking time bomb.

I meant it. I'm done with static site generators built by others. They have caused me too much pain.

EDIT: That "oops" is already reality: https://github.com/Fizzadar/Luapress#luapress-v4

Static site generators are just too easy to build and too easy to let die. And the ones that don't die grow big and bloated. That's my experience. The only remedy I see is to build my own and simplify ruthlessly through tight coupling.

"You either live long enough to see yourself become the villain, or you die a hero."

Re: Rewriting my blog in Rust for fun and profit

#77
post #72

Earlier quoted context omitted.

Nice! I have a Hugo site I’ve tweaked over the years, and my workflow is similar to yours. I create/edit an MD file, then run a shell command which pushes changes to Github, which triggers a redeploy. How do you handle images? That’s my main annoyance / biggest hurdle when publishing. I have to take each image, resize it for web, put it in static folder, and reference that pathname in the MD file. Not a big deal, but…

We are working on https://imgs.sh which will try to make optimizing for web automatic as well as making it easy to reference images from your blog.

btw the example image (https://erock.imgs.sh/t/iceland) 404's :(

Re: Rewriting my blog in Rust for fun and profit

#79

This is mindblowing synchronicity. I thought this article was one I had read this weekend for a second but checked the post date and saw it wasn't available yesterday. I'm working on trying to write a static site generator for my own personal site/blog in C++, been tinkering for a couple months. It started as a passion project in tribute to my dog that passed. GatsbyJS wasn't working (again) which is what my current…

Sorry for your loss.

Re: Rewriting my blog in Rust for fun and profit

#80

Earlier quoted context omitted.

I plan on trying https://luapress.org/ one of the next weeks. Looks good at a first glance -- give it a quick check if you get a free hour, would be interested what you think of it.

I don't have a free hour unfortunately. And I know I'm not going to use that because I don't want to setup a Lua environment. Indeed, I have enough Lua experience to know that they break the language in big ways for what seems like every release. That's a liability. What happens when luapress stops getting regular maintenance and the version of Lua it uses is no longer packaged in my Linux distro? Oops. Ticking time…

> Static site generators are just too easy to build and too easy to let die. And the ones that don't die grow big and bloated.

Sadly you're right. I've been monitoring in the trenches for a while and what you said is covering it perfectly.

RE: maintenance, I was aware but was wondering whether Luapress is mature and complete enough to not need maintenance. I'll give it a go.

And I truly get your point about point releases of languages breaking stuff. I am severely burned out on that front myself that's why my next game plan is to buy and setup a Linux workstation and just isolate various software pieces that I [might] need in Docker containers and periodically backup those for extra good measure.

I am done with all that constantly moving and breaking crap as much as you are. Just looking to find software for all my needs and nail its versions and installs and just allow myself to not constantly keep up with the youngsters' play toys.

Appreciate all your software contributions and a good part of them are my favorite in their area.

Post reply on HN