I create a lot of websites. I'm also a big fan of very performant, very accessible websites. I'm also a big fan of the phrase "the important thing first is for a webpage to exist, then after that to look nice".
With that in mind, this is the HTML template I usually start with to make a new webpage. It's made to manually replace the things in curly brackets, but also has the bonus that you could use it with a templating language like https://handlebarsjs.com/ (my favourite).
<!DOCTYPE html><htmllang="en"><head><!-- browser metas --><title>{{title}}</title><metaname="description"content="{{description}}" /><!-- allow unicode characters --><metacharset="utf-8" /><!-- 'zoom' on mobile --><metaname="viewport"content="width=device-width, initial-scale=1.0" /><!-- embed metas - https://ogp.me/ - visible when sharing on social media --><metaproperty="og:title"content="{{title}}" /><metaproperty="og:type"content="website" /><metaproperty="og:site"content="{{title}}" /><metaproperty="og:url"content="{{base_url}}/{{page}}" /><metaproperty="og:image"content="{{base_url}}/{{image}}" /><metaproperty="og:description"content="{{description}}" /><metaproperty="og:locale"content="en_GB" /><!-- styling --><!-- favicon - can be any image (.png, .jpg, .ico) --><linkrel="icon"type="image/png"href="/og-image.png" /></head><body><header></header><main>
{{{content}}}
</main><footer></footer></body></html>
Put it somewhere, and put something in there! Make a personal website! Make a blog! I will love you forever.
Naturally, you usually want to turn them back into characters, usually UTF-8. I came across a particularly gnarly site that had some normal HTML entities, some rare (Unicode) ones, and also some special characters that weren't encoded at all. From it, I made file to test HTML entity decoders on. Here it is, as file.txt:
Children's event,
Wildlife & Nature,
peddler-market-nº-88,
Artists’ Circle,
surface – Breaking
woodland walk. (nbsp)
Justin Adams & Mauro Durante
I wanted to find a way to convert the entities (i.e., decode '&º, but NOT decode ’– (nbsp) &) with a single command I could put in a bash pipe. I tried several contenders: