3 ms·
This is the exact thing I experienced and have been dealing with the past couple days. I wanted to create a small collection of pages as my website, intending t
by LeonenTheDK 6y ago
This is the exact thing I experienced and have been dealing with the past couple days. I wanted to create a small collection of pages as my website, intending to keep everything as small and simple as possible since it was (mostly) just to display some basic info and "posts". Well as soon as I wanted that menu for pages it was a whole new can of worms.
Sure, I could just copy/paste/replace content as it changes. But I don't want to have to be doing that any time I decide I want to change or add something. And I'm known to be a source of human error.
I ended up going Node+Express+EJS for the includes and certain more dynamic content on pages. It works well enough, page sizes are still small. Also considered some static site generators but at the time they seemed like overkill for what I wanted. Maybe there's a tool out there that will compile to plain old HTML files that I'm unaware of, I don't keep up much on front-end things.
- mouzogu 6y agoHTML, CSS and SSI includes would be an easier option. If you don't want to deal with Node.
- LeonenTheDK 6y agoI was unaware of SSI, thanks for pointing it out. I'll be taking a look at that tonight.
- robertoandred 6y agoHow do you set the state of a nav with SSI? Does it know what the page being built is?
- mouzogu 6y agoYou can use variables in SSI and if/else conditions. So you could set state based on the URL or other environment variables. It's actually fairly powerful and you can get quite a lot done with it. https://httpd.apache.org/docs/current/howto/ssi.html https://httpd.apache.org/docs/current/howto/ssi.html