Do you still need <meta http-equiv="x-ua-compatible" content="ie=edge">? I think this only affects IE10 and earlier, and even in those cases it doesn’t really seem needed if you have <!doctype html>.
It’s not cargo-culting, it’s just telling you to delete the content that’s already there because it assumes you don’t want the original content.
Although I really don’t see the point of the website, just have a local file with your own version of that or a snippet in your favorite editor and that’s it. I thought there was some trickery with curl being detected server side to serve a page without the content but no…
You don’t need <head> or <body>. If <html> didn’t have a lang tag you wouldn’t need that either. Also, as @arp242 already mentioned, you probably don’t need x-ua-compatible anymore.
The goal of this project (which probably isn’t explained well) is to provide a base template to be extended. With that goal in mind, I think it makes sense to include <head> and <body> tags as a placeholder for people to add to. It’s the same reason that the chartset / viewport / description / title tags are included in the head.
Edit: Seeing your PR is making me ponder this comment a little – but I’m still not sure I’m ready to ditch those wrappers.
I think your HTML file would be silly if it didn’t include <head> and <body>. If someone is trying to golf every last byte out of their HTML file then fine, but it would be odd to use such a thing as a starting point.
It’s often been said that the regular expression that matches HTML is simply .*, so realistically speaking you don’t need anything – but that sounds like what an edgy teen who says “you don’t need to do anything but die (… so I won’t do my homework)”.
unfortunately, if you are developing a plain HTML website and using something like live-server to watch for changes as you edit the file, it needs the <html><body> tags to work properly.
That’s probably a bug. The DOM won’t look any different if you omit <html><body>, as the tags are implied. I don’t know live-server, but I suppose it looks for these tags to figure out where to inject its auto-reload JS magic?
lang=en – does this improve anything? Does it stop Chrome from showing you annoying and incorrect translation pop-ups?
<meta charset=utf-8> – I believe this is better because you don’t always control the web server, and the default Content-Type header does not include UTF-8. So I should add this to my other site.
I think it’s a little unclear where the “delete this” part is supposed to end. (I mean, it’s clear to me, but I do this professionally.) I would suggest adding a blank line before </body> and/or another comment saying “end of the section to delete” or something like that.
For whatever it’s worth: I wrote something vaguely similar a while back, which produced a decent amount of discussion here.
Do you still need
<meta http-equiv="x-ua-compatible" content="ie=edge">
? I think this only affects IE10 and earlier, and even in those cases it doesn’t really seem needed if you have<!doctype html>
.This is a good callout, I’ll remove this now since it’s a remnant of my time building for IE10.
It would be cool if the “delete this” part explained it. I try to avoid cargo-culting.
It’s not cargo-culting, it’s just telling you to delete the content that’s already there because it assumes you don’t want the original content.
Although I really don’t see the point of the website, just have a local file with your own version of that or a snippet in your favorite editor and that’s it. I thought there was some trickery with curl being detected server side to serve a page without the content but no…
… /s?
No, I mean have it explain the rationale behind the specific meta tags, etc.
You don’t need
<head>
or<body>
. If<html>
didn’t have alang
tag you wouldn’t need that either. Also, as @arp242 already mentioned, you probably don’t needx-ua-compatible
anymore.-edit: source (via)
The goal of this project (which probably isn’t explained well) is to provide a base template to be extended. With that goal in mind, I think it makes sense to include
<head>
and<body>
tags as a placeholder for people to add to. It’s the same reason that the chartset / viewport / description / title tags are included in the head.Edit: Seeing your PR is making me ponder this comment a little – but I’m still not sure I’m ready to ditch those wrappers.
I think your HTML file would be silly if it didn’t include
<head>
and<body>
. If someone is trying to golf every last byte out of their HTML file then fine, but it would be odd to use such a thing as a starting point.It’s often been said that the regular expression that matches HTML is simply
.*
, so realistically speaking you don’t need anything – but that sounds like what an edgy teen who says “you don’t need to do anything but die (… so I won’t do my homework)”.unfortunately, if you are developing a plain HTML website and using something like
live-server
to watch for changes as you edit the file, it needs the<html><body>
tags to work properly.That’s probably a bug. The DOM won’t look any different if you omit
<html><body>
, as the tags are implied. I don’t knowlive-server
, but I suppose it looks for these tags to figure out where to inject its auto-reload JS magic?(yep, it seems like that’s the problem, and someone made a PR to fix this in 2017, is the project dead?)
Are we code golfing html templates now.
Here’s mine:
0 characters. Any browser will display it just fine. You’re welcome.
Hm I like the idea of having it online, might put up my own … I have to copy this between static files, Python, and now PHP (yes I wrote PHP :) )
Here’s one I just made:
which I now realize is inconsistent with oilshell.org:
lang=en
– does this improve anything? Does it stop Chrome from showing you annoying and incorrect translation pop-ups?<meta charset=utf-8>
– I believe this is better because you don’t always control the web server, and the defaultContent-Type
header does not include UTF-8. So I should add this to my other site.lang is also used to set hyphenation rules. I believe there are some accessibility considerations for screen reader pronunciation, too.
I think it’s a little unclear where the “delete this” part is supposed to end. (I mean, it’s clear to me, but I do this professionally.) I would suggest adding a blank line before
</body>
and/or another comment saying “end of the section to delete” or something like that.Looking forward for an essential.html project with a template for useful tags.