News for hackers. Stuff that matters.
Re:How to build a personal webpage from scratch by fergie on Thursday September 29, 2022 @03:57AM (#33017691)
The big thing missing from vanilla HTML is templating.

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

Re:How to build a personal webpage from scratch by Devasta on Thursday September 29, 2022 @05:20AM (#33018163)
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.
Re:How to build a personal webpage from scratch by intrasight on Thursday September 29, 2022 @09:52AM (#33020621)
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.
Re:How to build a personal webpage from scratch by ktpsns on Thursday September 29, 2022 @04:35AM (#33017881)
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.
Re:How to build a personal webpage from scratch by fergie on Thursday September 29, 2022 @05:20AM (#33018154)
Right, but you cant run an XSL processor without an application server? Or could you?
Re:How to build a personal webpage from scratch by genmon on Thursday September 29, 2022 @06:03AM (#33018436)
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)

Re:How to build a personal webpage from scratch by notRobot on Thursday September 29, 2022 @08:28AM (#33019610)
That's so cool!!
Re:How to build a personal webpage from scratch by intrasight on Thursday September 29, 2022 @09:50AM (#33020598)
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.
Re:How to build a personal webpage from scratch by superkuh on Thursday September 29, 2022 @10:03AM (#33020768)
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.
Re:How to build a personal webpage from scratch by masswerk on Thursday September 29, 2022 @11:01AM (#33021672)
And, if you need more, there's still PHP, as kind of server side includes on steroids.
Re:How to build a personal webpage from scratch by jen729w on Thursday September 29, 2022 @04:16AM (#33017788)
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.

Re:How to build a personal webpage from scratch by Nathanael_M on Thursday September 29, 2022 @05:16AM (#33018124)
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/

Re:How to build a personal webpage from scratch by jbverschoor on Thursday September 29, 2022 @04:22AM (#33017823)
If you're able to run react, you should be able to run any templating engine as well.
Re:How to build a personal webpage from scratch by Moru on Thursday September 29, 2022 @04:43AM (#33017914)
You used FRAMES ofcourse :-)

(Now obsolete though)

Re:How to build a personal webpage from scratch by fergie on Thursday September 29, 2022 @05:22AM (#33018175)
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.
Re:How to build a personal webpage from scratch by romeoblade on Thursday September 29, 2022 @04:36AM (#33017884)
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.
Re:How to build a personal webpage from scratch by fergie on Thursday September 29, 2022 @05:18AM (#33018141)
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.
Re:How to build a personal webpage from scratch by ohbtvz on Thursday September 29, 2022 @06:57AM (#33018844)
Re:How to build a personal webpage from scratch by intrasight on Thursday September 29, 2022 @09:47AM (#33020551)
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.
Re:How to build a personal webpage from scratch by jbverschoor on Thursday September 29, 2022 @04:21AM (#33017815)
Because templating is yet another language to be interpreted. HTML was simple and very effective for its purpose: documents.