So. Idiot me is back. I still can’t get my head around the benefit of using a static site generator/command lines over just creating the files etc by hand? Obviously it’s just because I’m used to creating by hand using html and css rather than markdown etc, but I care to be educated! Why is no one doing it this way anymore? It seems more time consuming to me to download the relevant programs and sift through lots of files every time I need to update.
I feel I must be missing something? #teachme

@siobhan They let you have common parts/components. Like headers, footers, or even things like buttons that have a fixed style.

You can’t “include” one HTML file from another without doing some “build” step. This could be a command line tool. Or it could be something like Dreamweaver (back in the day).

@siobhan Having said that, many static site generators are overkill and have a ton of features that you don’t need.

What’s your skill set? Perhaps I can help you find something appropriate?

@ross ultimately I started about 25 years ago building basic html pages with css, learnt to add php (for the includes!) and eventually moved to Wordpress! Now I’m fed up with Wordpress and want to return to building without bloated CMS code - but the world has changed and everything seems to be created differently now! I need to update my knowledge but it seems I need to learn a completely new way of coding 

@siobhan You don’t need to change a thing!!

Sure. There’s lots of options for.l new ways to do things. And CSS is WAY better.

But the basics still work. And static hosting of files is now so free and easy.

E.g. https://app.netlify.com/drop

Or https://puter.com/ which lets you share a folder as a website

Netlify

Start building the best web experiences in record time

@siobhan Start small. Start with what you know. Enjoy getting re-started. Add on new things later. 👍

@siobhan I took the rite-of-passage that is building your own static site generator. This may be helpful insight into what and why.

Also, this helps you to not have to trawl through files. If you update a link in the header or footer you only do it once! 🙌😃

https://rosswintle.uk/2021/12/hang-on-php-is-a-static-site-generator/

Hang on, PHP IS a static site generator! - Ross Wintle

Regular followers will have heard me talk about Turbo Admin. And you may also know that I am, where possible, trying to #DitchTheBuild and use vanilla HTML, CSS and JS as much as possible. So for the Turbo Admin website I kinda wanted to embrace this philosophy, get cheap-and-easy, static-file hosting, and make my build […]

Ross Wintle

@siobhan Ultimately the problem is you can't include stuff easily with just the web stack (headers, footers, etc).

Also I suppose it's slightly easier to write a post in Markdown than HTML, but eh.

I think it's largely just a matter of getting used to one workflow or the other. If you've got a way of achieving your goals, you don't need to switch to an entirely different system just to accomplish the same end result.

.@Tijn this makes sense. I’m essentially moving away from Wordpress - but my previous online experience was building UP to Wordpress (html, css then php) so now I feel I have to unlearn a whole way of creating sites… but perhaps you’re right and so don’t? 🤞🏻
@siobhan If you're able to include headers & footers through PHP, that's just as valid and it means you can write the whole thing in pure HTML, no problem at all. Style it with CSS and boom, you've got a website. No build steps required.
@Tijn thank you, this I CAN do - it just seems dated but perhaps I can rephrase and call it vintage or something equally quirky 😅

@siobhan The reason why people like static sites is because it puts no requirements on the web hosting. You can dump your files anywhere (github, cloud storage) and hey presto it's a website.

But if you've got PHP support anyway, there's nothing wrong with using it. At least, in a sensible way that doesn't open the door to hackers.

@siobhan As always with web stuff, it pays to start out extremely small and focussed rather than following "starter projects" or tutorials drowning in features.

The main benefit is "includes". Code the navigation once, just include it where you need it. Etc.

After that, templating languages of some sort to speed up HTML generation, like when you have many examples of the same thing on one page.

Start small and tightly focussed if you do go for a SSG (or framework, or anything really)

@siobhan IMO there's a *massive* benefit in knowing for yourself what problem you have that you want to solve - rather than "what can this tech do", because it's so easy to get distracted or lost if you don't know why you're looking at a thing in the first place. This is also why I prefer "ground up" learning to "top down" learning.
@mattwilcox yes I think starting small is the key here!
@siobhan There’s nothing wrong with the hand-crafted approach at all, and this might be the best option for many simple sites! But if (for example) you have lots of blog posts, and some of these are quite long, writing in markdown is a far more pleasant experience than wrapping every paragraph in a <p> tag...plus if you have 200 pages with the same base HTML (just different content) and you want to change something that’s 200 places you’ve gotta change it
@siobhan Sorry, in the time I took to write this I see a lot of people have basically said the same thing, so feel free to ignore me!
@michelle no no please, it’s reaffirming to hear it from many 😁
@michelle yes definitely. I used php includes back in the day to navigate the issue of having to update elements frequently- but they seem to have gone of out fashion outside of big bloated CMS…

@siobhan @michelle I think the timeline roughly went:

- wow PHP is cool, I can just include my header & footer once and be done with it

- wow PHP is really cool, I can build elaborate content management systems with it

- damn my website got hacked, PHP sucks

@siobhan I reckon there are three things at play here:

1) The neat ability to add something new to your site and everything is updated everywhere (e.g. a new navigation item)

2) Being big open source frameworks

3) Novelty. It’s a new take on a decades-old idea. Techies love new toys.

@siobhan This post is a big mood 😅 And I get where you’re coming from. Others have replied with helpful suggestions, but even as someone who works on this kind of stuff professionally, I miss the old way of crafting things and tend to steer clear of using new tools in my personal projects. I don’t even feel like I’m best placed to point you in the right direction with that stuff 🫠😆
@siobhan I also just returned home from a conference with a lot of indie web aficionados, so I’m definitely leaning more towards encouraging you to do it the way you want 😂
@heygeorgie Hi! I have visited your website quietly since (quite possibly) its incarnation and have always considered it an inspiration… so, and I know it’s WP based, I’d argue you’re perfectly placed to share wisdom 
@siobhan Hahaha I know you have been a long time visitor/reader—you are too kind 💛 Despite using WordPress, I still feel I haven’t done much that’s innovative 😆

@siobhan

as an aside (not an answer to your question), you and others in this thread may find https://front-end.social/@ppk/112769187805097543 interesting, and the thread it’s in that Sara started

ppk 🇪🇺 (@[email protected])

@SaraSoueidan Err .. good old SSI does wat HTML partials imports do, right? Or am I misunderstanding something profound here?

Front-End Social