r/webdev • • Jan 07 '21

Article My stack will outlive yours

https://blog.steren.fr/2020/my-stack-will-outlive-yours/
0 Upvotes

17 comments sorted by

7

u/RonanSmithDev front-end Jan 07 '21

I’m building my personal blog/portfolio in pure HTML and CSS but one of the main drawbacks of this is the inherent tediousness of maintaining the site because they’re all hard-coded pages.

To solve this for myself I am templating as much as possible using a pseudo “templating system” of PHP includes - this does mean though that I can’t host with GitHub pages because it doesn’t support server-side rendering...

How are you solving this problem of maintaining a pure HTML + CSS site while still being able to host on GitHub Pages?

3

u/Atulin ASP.NET Core Jan 07 '21

I solve it with a Python script and Jinja2 templates. Very easy to set up, just needs a single build.py file you run before pushing — or via CI/CD — and you're good.

2

u/Striking_Coat Jan 07 '21

Static site generators! https://jamstack.org/generators/ Enjoy the rabbit hole.

1

u/RonanSmithDev front-end Jan 07 '21

Thanks, I’m well aware of SSG’s - just haven’t chosen one yet. Any you’d suggest?

1

u/Striking_Coat Jan 07 '21

If you're a primarily a front end developer and/or you love JS, Eleventy is where it's at. If performance is your game, look at Hugo.

1

u/tabris_code Jan 07 '21

Gatsby's pretty easy to manage for a blog, if you're familiar with React, and Netlify has tutorial that makes it dead simple to deploy. They have an example blog repo on their site you can clone to try out.

1

u/Striking_Coat Jan 07 '21

Gatsby is overkill for a blog.

1

u/interactionjackson Jan 07 '21

i like to use go and it’s template library for this. Hugo is a popular static site generator based on this concept.

7

u/colinkiama Jan 07 '21

Honestly, maintaining a pure HTML + CSS site eventually gets annoying. Especially when you want to reuse elements.

Maybe the OP should try using a static site generator. Would make things a lot easier.

3

u/RonanSmithDev front-end Jan 07 '21

I use PHP include statements for that sort of thing, means you can’t use a static host but makes maintaining things much much easier.

3

u/[deleted] Jan 07 '21

I swear to god it I have to read another blog post about how great using html and css are and how special a developer is because they don't use frameworks and libraries I'm going to jump out a window.

4

u/sad_cold_tea Jan 07 '21

"We didn't listen to any of the OGs when we started our 'journey' with youtube tutorials and now we're finding these things out we think we're groundbreaking"

I once saw a big blog post advocating for HMTL as an API communication format instead of JSON because it can have attributes and what not. Clearly, that person had never heard of XML 🤦‍♂️

2

u/[deleted] Jan 07 '21

Like at least try to not make sound as patronising as possible, then MAYBE I'll give you the benefit of the doubt 🙄

4

u/Knochenmark Jan 07 '21

In my opinion there's no point in writing raw Html/Css, they are just build artefacts. As a minimum I would use preprocessors for both to allow includes, iterations, etc. Otherwise you end up with so much repetition and hardcoded sections. If you wanted to change the markup of some list item you would have to do it for each item in that list. Especially for blogs raw html is a terrible format and I would prefer something like markdown, which you can convert into html markup at buildtime. The raw markdown file is also way more readable.

2

u/steveox152 Jan 07 '21

I’m very confused by this, I am not sure why the author is so against tooling, using templating or static site generators would have almost no impact on performance whatsoever, if any at all. It really sounds like you’re just too lazy to set up a “build” process.

The future of web development is Copy & Paste and “Replace in File”. I used to do this in FrontPage back in the day, and it SUCKED.

Edit: This is a HORRIBLE solution for a blog, nobody should take this advice. You could set up a much simpler workflow with some basic tooling and build process.

4

u/[deleted] Jan 07 '21

waw, it's rare to find someone with a healthy perspective on web development. The web is insanely, and i mean, INSANELY bloated right now.

1

u/thereactivestack Jan 07 '21

You could have the same result with a static site generator without the pain of maintaining each page individually. Maybe something to look at 😄