Hacker News new | ask | show | jobs
by 3zra 1353 days ago
This is really great!

I wonder if one needs a framework like Hugo, Jekyll, etc. if one only wants to host a personal site without a blog? Is there any advantage compared to starting with one of those bare CSS templates and building a static website that way?

5 comments

Wonder no more, you 100% do not.

I use http://zim-wiki.org + a customized template.

http://jrm4.com is it.

side topic - instead of teaching PHP in your Advanced Web Development course, consider teaching React instead?
Genuine question: why would you teach a framework instead of a programming language?
JavaScript is a programming language (and can be used in this course for the front end and back end)
If you want to have a simple web presence, you might want to look at some "elder self-hosting sites" (i.e pre f*book) like https://www.dreamwidth.org where you could easily set up your personal site, as I already mentioned in another comment.

Disclaimer: just a self hoster, who experimented with dreamwidth.org some years ago, and no fan of todays dominant "social" media sites.

The big thing missing from vanilla HTML is templating.

I dont fully understand why it has never been included in the HTML standard.

There is one, XSLT. However, outputting valid XML was considered too arduous for the average webdev so we need to reimplement everything we want in JS instead.
XML and XSLT has been a mainstay of my career for over 20 years. They are web standards with multiple implementations. It'll keep plugging along for another 20 years while all these other proprietary "frameworks" come and go.
To be fair, when XML was cool, XSL did a good job in carrying out templating-language-like-features. Use case was like: Write semantic XML document, use XSL to generate XHTML, render XHTML in browser. Modern browsers still run XML with XSL.
Right, but you cant run an XSL processor without an application server? Or could you?
It works in the browser.

For example, my RSS feed is processed with XSL to provide a friendly landing page:

https://interconnected.org/home/feed

(view source, second line)

That's so cool!!
I still use browser-side XSLT in my apps. Google had threatened to remove support but there was much pushback from the enterprise community that has many business apps using that approach so Google backed down. Still no guarantee that they'll pull the plug in the future.
Almost all webservers have support for server side includes. SSI are very limited and basically all you do is include one html file in another html file like <!--# include file="/footer.html" -->. It is the perfect combination of templating power and static html. It allows you to avoid all of the complexities of "static site generators" and "deploying" and all that cargo cult jazz.
And, if you need more, there's still PHP, as kind of server side includes on steroids.
Yes x 1,000,000. This is the only thing that drives me to something like React (other than the fact that I’m not actually a programmer and it’s the only thing I know) to build a site.

I know HTML! I know CSS! But how do I make a template sidebar, say, without a framework. It’s possible, sure. But a PITA. React just makes it easy, which is like using a baseball bat to kill a fly.

Check out Eleventy[0]. It’s my static site generator of choice. It’s pretty simple to pick up, high HIGH use case ceiling, and delightfully quick. Works with a bunch of different templating languages, too.

[0] https://www.11ty.dev/

If you're able to run react, you should be able to run any templating engine as well.
You used FRAMES ofcourse :-)

(Now obsolete though)

You are undeservedly downvoted. I think that there is a strong case for using frames as a templating strategy for static sites that are hosted on say S3 or Github.
Server Side Includes was probably the only thing that came close. While not actual templating, it did serve me well for code reusability and being able to make updates in one place. I made heavy use of them, even after discovering php3. It wasn't until I discovered smarty that I stopped using them. I miss those simpler days.
SSIs are actually still a thing, but they are webserver dependent- so if you are hosting your static pages on say S3 then they wont work.
HTML Imports is (was) an awesome solution to client-side declarative composition. Sadly, it never gained traction in browsers - mainly because Mozilla said they won't implement it. The only option now is imperative code.
Because templating is yet another language to be interpreted. HTML was simple and very effective for its purpose: documents.
You can always just write plain HTML/CSS and upload it to a (paid) webserver like you did 20+ years ago.