Hacker News new | ask | show | jobs
by chefandy 549 days ago
My interest in this is piqued. I’m really happy to see people doing things to simplify personal standalone website authorship making it expressive and flexible without a bulky content management system or jumping through hoops for some front-end toolchain. I know when I’m developing things I’m often as or more concerned with satisfying multiple use cases or functionality extensibility, but having a nice focused tool polished for one use case is nice. When I was deep in web dev and had my machine set up with a selection of go-to docker setups for different dev needs and the knowledge of how that all needed to be orchestrated was fresh in my mind, deploying most of the SSGs or whatever seemed trivial. Now in the odd event that I have a personal project or whatever that indicates more than just a few static handmade pages, the first thing I do after looking up what todays web world consider to be the “obvious” best tools and practices is see how many people are asking about counterintuitive config issues or other getting-started type problems. As cool as whatever application might look, I know I’ve got about two good hours in me of recall, research and troubleshooting before I just say “fuck it. Guess I didn’t want to do that project anyway.” The point of those tools is to save time and energy — you don’t have to get very far outside “the loop” for it to take more effort than it’s worth to get back in for a lot of them. Simple tools for simple tasks are great when you know you’ll never ever need built-in hooks to wrangle graphql queries and automatically invalidate CDN caches and generate 10 sizes of images optimized for every conceivable device or whatever.
1 comments

Whats wrong with just using HTML, Js and CSS for personal projects?
I do that. Duplicating the header, menu, and footer manually on every page is a pain in the ass. Not to mention the lack of minification.
Not sure I follow, do you not use templates and scripts to generate the static pages?

I was a web developer 25 years ago and for the majority of projects we only made static sites, all templated and minified. My skills are somewhat "of that time".

Recently I was asked to build a site to demonstrate some new software. It consisted of over 10k pages that once built would rarely, if ever be updated.

I just scripted and templated the generation of every single page hosted it in S3. This may sound ridiculous in this day and age but it takes a few minutes to rebuild and update the entire site.

Guess my point is I don't really find duplicating things to be a pain in the ass

I don’t think it sounds ridiculous, it sounds like you picked the right tool for the job. Don’t bring dynamic solutions to static problems…
What the grandparent comment was referring to was eschewing static site generators in favor of entirely handmade html and css. The person you’re responding to was arguing in favor of static site generators for the reasons they listed. I was advocating for a simpler breed of SSGs than we have now for simple tasks, and this project seems to fit that niche. Most SSGs these days are only trivial if you’ve got current web developer knowledge at your finger tips.
Yes, that's what I meant.
That isn’t ridiculous and is in fact how the bulk of modern static site generators work. Hugo, Jeykll, Astro (the one I use), etc.
I think this issue better addressed in HTML spec. Basic functionality to include html snippets files in other HTML files should be standard. What am I missing?
Well, the HTML spec is missing that, has been for decades despite people asking for it, and to my knowledge has never even made it to a roadmap.
How would that work? Now one request for a page becomes N requests for every bit of HTML the client needs to render?
That’s sorta the case with frames and asynchronously loaded stuff anyway though right? I think they just consider the problem solved in practice through scripting and frames. Besides, HTML doesn’t have room for that— they need room for all the features nobody uses and cares about. XD I’ve been writing HTML to some extent for 30 years and I periodically come across shit— not even new shit— that I swear I’ve never even heard of.
> That’s sorta the case with frames and asynchronously loaded stuff anyway though right?

Yeah, and that's not something to emulate. And if so, it sort of already exists in the spec: iframe.

You could cache the intermediate bits. Hell you could do this right now (somewhat) by doing script src=menubar.js and the script containing document.write calls. Not great for performance.
Wouldn't that just ends up re-inventing XML and <xsl:include> ?
It is - it is called frames.
Serverside includes are a thing in Apache or nginx.

If you don’t mind a little coding, it wouldn’t take long to build a tool that lets you store the bodies as template files, wraps them in the header/footer, and minifies them.

Even less effort is pandoc’s standalone mode which lets you provide a wrapper template.

Yeah SSI solved this 30 years ago. It's kind of a fire and forget solution too.
Why do you care if your personal site is minified?
Because some people care about low-bandwith users. Or about not being wasteful as a principle.
Doesn't compression make any minification gains negligible?
Depends on what you’re serving up. Blog? Yes. Video game? No.
You can just have git submodules for that.
Nothing, if they’re simple enough to do that. Not all of them are. I’m a commercial artist and designer, so things like layout are important and need to be updatable on multiple pages because individual pieces often have their own pages. Updating 15 nav headers in a gallery on your site to save a couple of hours setting up something better suited to the task is just terrible architectural planning. At the same time, I don’t need an embedded rich text formatter and CDN support and azure integration and blah blah blah. Use the right tool for the job, and my job often calls for something ostensibly like this, which fits a neat niche.
Yea my point was that people love to overcomplicate their stuff. Having a whole infrastructure for a personal project that isnt even started yet is insane.
That depends on the project. I’m a technical artist— sometimes my personal projects get pretty elaborate and pretty technical and don’t have the equivalent of an MVP that can be put together with a few handmade pages. Even something like a simple gallery of images that each have their own page (or the functional equivalent) is going to involve a ridiculous amount of manual work right off the bat. The only dumb way to approach it is not considering the right tool for the job.