Rewriting my website in plain HTML and CSS
217 comments
·January 14, 2025uncheckederror
tannhaeuser
> copy and paste content and not having layout page is annoying at times
HTML was envisioned as an SGML application/vocabulary, and SGML has those power features, such as type-checked shared fragments/text macros (entities, possibly with parameters), safe third-party content transclusion, markup stream processing and filtering for generating a table of content for page or site navigation, content screening for removal/rejection of undesired script in user content, expansion of custom Wiki syntax such as markdown into HTML, producing "views" for RSS or search result pages in pipelines, etc. etc. See [1] for a basic tutorial.
[1]: https://sgmljs.net/docs/producing-html-tutorial/producing-ht...
kreetx
I didn't expect this to be serious and am surprised on that the tutorial actually delivers. Way back when I was learning HTML and it was said that it was built with SGML, then this relation remained a total mystery to me.
TeMPOraL
> I didn't expect this to be serious and am surprised on that the tutorial actually delivers.
Same here. I believed that SGML was like Lisp of markup languages, except that it went completely extinct. Good to see it's still usable, I feel like I want to try it out now (instead of making a third generation of my static site generator from scratch).
dmsnell
I’ve become quite a fan of writing in SGML personally, because much of what you note is spot-on. Some of the points seem a bit of a stretch though.
Any type-checking inside of SGML is more akin to unused-variable checking. When you say that macros/entities may contain parameters, I think you are referring to recursive entity expansion, which does let you parameterize macros (but only once, and not dynamically within the text). For instance, you can set a `¤tYear` entity and refer to that in `copywrite "¤tYear/¤tDay`, but that can only happen in the DTD at the start of the document. It’s not the case that you could, for instance, create an entity to generate a Github repo link and use it like `&repoName = "diff-match-patch"; &githubLink`. This feature was used in limited form to conditionally include sections of markup since SGML contains an `IGNORE` “marked section”.
<!ENTITY % private-render "IGNORE">
...
<![%private-render[
<side-note>
I’m on the fence about including this bit.
It’s not up to the editorial standards.
</side-note>
]]>
SGML also fights hard against stream processing, even more so than XML (and XML pundits regret not deprecating certain SGML features like entities which obstruct stream processing). Because of things like this, it’s not possible to parse a document without having the entire thing from the start, and because of things like tag omission (which is part of its syntax “MINIMIZATION” features), it’s often not possible to parse a document without having _everything up to the end_.Would love to hear what you are referring to with “safe” third-party transclusion and also what features are available for removal or rejection of undesired script in user content.
Apart from these I find it a pleasure to use because SGML makes it easy for _humans_ to write structured content (contrast with XML which makes it easy for software to parse). SGML is incredibly hard to parse because in order to accommodate human factors _and actually get people to write structured content_ it leans heavily on computers and software doing the hard work of parsing.
It’s missing some nice features such as namespacing. That is, it’s not possible to have two elements of the same name in the same document with different attributes, content, or meanings. If you want to have a flight record and also a list of beers in a flight, they have to be differentiated otherwise they will fail to parse.
<flight-list>
<flight-record><flight-meta pnr=XYZ123 AAL number=123>
</flight-list>
<beer-list>
<beer-flight>
<beer Pilsner amount=3oz>Ultra Pils 2023
<beer IPA>Dual IPA
<beer Porter>Chocolate milk stout
</beer-list>
DSSSL was supposed to be the transforms into RSS, page views, and other styles or visualizations. With XML arose XSL/XSLT which seemed to gain much more traction than DSSSL ever did. My impression is that declarative transforms are best suited for simpler transforms, particularly those without complicated processing or rearranging of content. Since `osgmls` and the other few SGML parsers are happy to produce an equivalent XML document for the SGML input, it’s easy to transform an SGML document using XSL, and I do this in combination with a `Makefile` to create my own HTML pages (fair warning: HTML _is not XML_ and there are pitfalls in attempting to produce HTML from an XML tool like XSL).For more complicated work I make quick transformers with WordPress’ HTML API to process the XML output (I know, XML also isn’t HTML, but it parses reliably for me since I don’t produce anything that an HTML parser couldn’t parse). Having an imperative-style processor feels more natural to me, and one written in a programming language that lets me use normal programming conveniences. I think getting the transformer right was never fully realized with the declarative languages, which are similar to Angular and other systems with complicated DSLs inside string attribute values.
I’d love to see the web pick up where SGML left off and get rid of some of the legacy concessions (SGML was written before UTF-8 and its flexibility with input encodings shows it — not in a good way either) as well as adopt some modern enhancements. I wrote about some of this on my personal blog, sorry for the plug.
https://fluffyandflakey.blog/2024/10/11/ugml-a-proposal-to-u...
Edit: formatting
tannhaeuser
Nice to meet a fellow SGML fan!
> When you say that macros/entities may contain parameters, I think you are referring to recursive entity expansion,
No, I'm referring to SGML data attributes (attributes declared on notations having concrete values defined on entities of the respective notation); cf. [1]. In sgmljs.net SGML, these can be used for SGML templating which is a way of using data entities declared as having the SGML notation (ie. stand-alone SGML files or streams) to replace elements in documents referencing those entities. Unlike general entities, this type of entity expansion is bound to an element name and is informed of the expected content model and other contextual type info at the replacement site, hence is type-safe. Data attributes supplied at the expansion site appear as "system-specific entities" in the processing context of the template entity. See [2] for details and examples.
Understanding and appreciating the construction of templating as a parametric macro expansion mechanism without additional syntax may require intimate knowledge of lesser known SGML features such as LPDs and data entities, and also some HyTime concepts.
> create an entity to generate a Github repo link
Templating can turn text data from a calling document into an entity in the called template sub-processing context so might help with your use case, and with the limitation to have to declare things in DTDs upfront in general.
> it’s not possible to parse a document without having the entire thing from the start, and because of things like tag omission (which is part of its syntax “MINIMIZATION” features), it’s often not possible to parse a document without having _everything up to the end_.
Why do you think so and why should this be required by tag inference specifically? In sgmljs.net SGML, for external general entities (unlike external parameter entities which are expanded at the point of declaration rather than usage), at no point does text data have to be materialised in its entirety. The parser front-end just switches input events from another external source during entity expansion and switches back afterwards, maintaining a stack of open entities.
Regarding namespaces, one of their creators (SGML demi-good James Clark himself) considers those a failure:
> the pain that is caused by XML Namespaces seems massively out of proportion to the benefits that they provide (cf. [3]).
In sgmljs.net SGML, you can handle XML namespace mappings using the special processing instructions defined by ISO/IEC 19757-9:2008. In effect, element and attributes having names "with colons" are remapped to names with canonical namespace parts (SGML names can allow colons as part of names), which seems like the sane way to deal with "namespaces".
I haven't checked your site, but most certainly will! Let's keep in touch; you might also be interested in sgmljs.net SGML and the SGML DTD for modern HTML at [4], to be updated for WHATWG HTML review draft January 2025 when/if it's published.
Edit:
> Would love to hear what you are referring to with “safe” third-party transclusion and also what features are available for removal or rejection of undesired script in user content.
In short, I was mainly referring to DTD techniques (content models, attribute defaults) here.
[1]: https://sgmljs.net/docs/sgmlrefman.html#data-entities
[2]: https://sgmljs.net/docs/templating.html
EvanAnderson
> Yes, you must copy and paste content and not having layout page is annoying at times. But the overhead of just doing it yourself is surprisingly small in terms of the time commitment.
This calls out for server side includes[0]. I so loved server side includes back in the late 90s. You still work in plain HTML and CSS, boilerplate can be centralized and not repeated, and clients receive the entire page in a single request.
wink
> But the overhead of just doing it yourself is surprisingly small in terms of the time commitment.
Holy cow. The sole reason I learned SSI and then PHP in 1998 was because I was sick of this after like 2 weeks.
This person has more patience in their pinky than I have ever had.
culi
> Yes, you must copy and paste content
Many people who maintain their own sites in vanilla web technologies tend to create reusable functions to handle this for them. It can generate headers and the like dynamically so you don't have to change it on every single page. Though that does kill the "no javascript required" aspect a lot of people like
Of course you could simply add a build step to your pure HTML site instead!
mixmastamyk
I recently learned the object tag can do what I wished for in the 90s... work as an include tag:
<object data="footer.html"></object>
Turn your back for twenty-five years, and be amazed at what they've come up with! ;-)Should reduce a lot of boilerplate that would get out of sync on my next project, without need for templating.
liontwist
Unfortunately that will require the client to make additional web requests to load the page, effectively doubling latency at a minimum.
johnisgood
Hey, I need to try this out, so it is like iframe except the frame part and all its issues?
culi
I didn't know you could use object tags in that way! Thanks. That seems like a great solution if you're cool with an extra request
mrweasel
Couldn't you sort of do that using server side includes back en the 90s? Assuming that your web server supported it.
8organicbits
I've adopted the idea that a blog post is archived when it's published; I don't want to tinker with it again. Old pages may have an old style, but that's OK, it's an archive. Copy/paste works great for this.
The only reason I use a blog engine now (Hugo) is for RSS. I kept messing up or forgetting manual RSS edits.
promiseofbeans
I really love this! I've seen it in action a couple times in the wild, and it's super cool seeing how the site's design has evolved over time.
It also has the benefit of forcing you to keep your URIs stable. Cool URIs don't change: https://www.w3.org/Provider/Style/URI.html
arkh
Or, let me be cheeky: you could add some `<php include('header.html')?>` in your html.
lelanthran
> It can generate headers and the like dynamically so you don't have to change it on every single pa
Yeah, I noped out of that and use a client-side include (webcomponent) so that my html can have `<include-remote remote-src='....'>` instead.
Sure, it requires JS to be enabled for the webcomponent to work, but I'm fine with that.
See https://www.lelanthran.com for an example.
[EDIT: Dammit, my blog doesn't use that webcomponent anymore! Here's an actual production usage of it: https://demo.skillful-training.com/project/webroot/ (use usernames (one..ten)@example.com and password '1' if you want to see more usage of it)]
culi
yeah clearly there's a lot of ways to solve this issue if javascript is enabled. But there's a big overlap between the folks who wanna use vanilla web technologies and the folks who want their site to run without javascript
spoonfeeder006
Isn't using React with a static site generator framework basically the same thing but better?
culi
Not remotely! Unless you meant Preact. React ships an entire rendering engine to the front-end. Most sites that use React won't load anything if javascript isn't enabled
mrweasel
Then you'd have to learn React, and for many of us the point is that we really don't want to learn React, or other frontend frameworks.
datavirtue
Yes, if you want to throw up in your mouth.
realusername
In theory yes, in practice good luck maintaining that if you are just a solo blogger.
I doubt your blog would last a single month without some breaking change of some sort in one of the packages.
lmm
Yes, it is. Unfortunately HN has a crazy bias against JavaScript (the least crazy part of the web stack) and in favour of HTML and CSS, even though the latter are worse in every meaningful way.
throwaway04623
> Yes, you must copy and paste content and not having layout page is annoying at time
I think this was one of the most common usages of PHP in the beginning, at least for those who basically wrote static HTML/CSS and needed a header/footer. It was probably a gateway into more advanced dynamic pages, eventually ending up using databases and other advanced functionality.
<?php include('header.inc'); ?>
<p>Here's a list of my favourite movies</p>
<ul>
<li>...</li>
</ul>
<?php include('footer.inc'); ?>
It would be great if HTML had a similar capability. People have asked for it for over 30 years, so it's unlikely that it will be implemented now.dspillett
> > Yes, you must copy and paste content and not having layout page is annoying at time
> I think this was one of the most common usages of PHP in the beginning,
> <?php include('header.inc'); ?>
And other tools beforehand: basic CGI or even more basic server-side includes (https://en.wikipedia.org/wiki/Server_Side_Includes)
To reduce CPU and IO load on the server (or just in circumstances where SSI was not enabled on the server they had available) some would pre-process the SSI directives (obviously this doesn't work for dynamic results such as the output from many #exec examples), so all that is being served is simple static files ‑ a precursor to more complex modern static site builders.
> It would be great if HTML had a similar capability. People have asked for it for over 30 years, so it's unlikely that it will be implemented now.
That doesn't really fit with the intentions of HTML, and could impose a bunch of extra network latency overhead compared to using SSI instead, leading to either complete rendering delays or jumpy pages as included content is merged in in steps, though I have seen it implemented multiple ways using a bit of JS (some significantly more janky than others).
mixmastamyk
See my reply about the object tag. Suffers from lack of press I guess.
liontwist
> Yes, you must copy and paste content
Manual work is almost never a good solution. Try this:
for PAGE in *.page
do
cat header.html "$PAGE" footer.html > “$PAGE.html”
done
AdieuToLogic
A slightly simpler version of same is:
for PAGE in *.page
do
cat header.html "$PAGE" footer.html > "$PAGE.html"
done
As noted in a peer comment, the cat[0] command supports concatenating multiple files to stdout in one invocation.HTH
EDIT: if you don't want the output file to be named "a.page.html" and instead it to be "a.html", replace the above cat invocation with:
cat header.html "$PAGE" footer.html > "${PAGE%.page}.html"
This syntax assumes use of a POSIX/bash/zsh shell.0 - https://man.freebsd.org/cgi/man.cgi?query=cat&apropos=0&sekt...
adamzochowski
Why not use server side includes? Most web servers support it, and it dates back to one of the early features of webservers.
<!--# set var="pagetitle" value="Main page" -->
<!--# include file="00__header.html" -->
... main content here
<!--# include file="00__footer.html" -->
liontwist
Because that requires a server with the proper config and this is an HTML file. So it works in every environment, like locally on your machine, or GitHub pages.
8n4vidtmkvmk
`cat` supports multiple files, no? The whole point is that it concatenates. Why use 3 commands?
liontwist
Because I’m typing on my phone and the line was long. Thanks!
dgfitz
Oh man, cattiness use of cat!
0xEF
This is my workflow for my site, too, just replacing MS Word with Obsidian since it syncs over all my devices allowing me to write/edit my future content wherever I am at, then upload later.
I tried things like bashblog for awhile, but it has some quirks like sometimes placing posts out of order when building the index page. That and I have zero use for the built in analytics options or things like Discus comments, so it seemed like I was really only using about 30% of what it was meant to do.
Here's a link to that for anyone interested. It's quite tweakable.
thu
> you must copy and paste content
I've started the Slab templating language[0] to be able to define reusable HTML fragments. It means using a dedicated tool but hopefully not needing to resort to a real programming language.
null
insonable
There's a lot you can do with just plain html these days if you just need a clean site. Here's an example from my recipe site (https://xilic.com/recipia/sauces/pesto_traditional.html), mostly for my personal use or sharing with friends, with only html/css. It has expandable boxes, a menu system, etc. A simple script converts a directory structure of .csv files to these recipe cards with a template, and this way you can edit the sources in a spreadsheet and then the publish script just takes whatever is new and re-does the whole lot of html as necessary. Just like we used to do with Apache Forest!
nayuki
Really appreciate that you're doing mass-based recipes, and in metric too. I'm tired of all the American recipes with quantities like "2 1/3 cups"; the proliferation of units and fractions makes work needlessly hard compared to just grams and millilitres.
0xEF
Furthermore, when it comes to recipes for baking, if it's not using weight as a measure, then it's wrong. Baking is chemistry, so if you want consistent controlled results, stop measuring anything by volume.
Sorry, pet peeve of mine as a hobby baker.
insonable
it's also just way faster to not mess with the spoons/cups! an exception might be little fussy quantities like a bunch of 1/4 tsps of different spices etc.
makizar
What a beautiful website ! Feels carefully crafted, full of nice moments like the > turning the a - when sections are open in the TOC. Would love to hear more detail on how you went about making it. Did you ever consider sharing parts of the source code ?
insonable
thanks! i first just made a sample html the way i thought it would be nice, then made that into a templeate, and wrote a python script generate the site. it first scans for all the files to build the menu and homepage, then goes file-by-file to make each one, filling in the blanks in the template as you can imagine. it was pretty natural since my spreadsheets were all following the same format already anyway. i'd be surprised if there was a lot of interest, but if so i'd consider sharing the script/template etc.
johnreagan
Love the site! Usually desert = dry place and dessert = delicious food.
insonable
thanks, good point!
HumblyTossed
what's the csv look like?
insonable
simple like:
title
subtitle
.. [two blank lines make a section break]
ingredients with 4 columns, last one is an optional comment for the row
..
method steps with 2 columns, last one is optional comment
..
then optional sections that just have to have:
section title (this is the collapsed title string too)
any rows included until the next .. etc. etc.
plus just a few tricks like if an ingredient comment has [] then it uses that as a URL for the ingredient, if a row in ingredients has just one column then it's a header etc.
azangru
Did he reinvent a static-site generator? Markdown, pandoc, makefile... Sounds like a job for hugo/eleventy/jekyll/whatever.
NoboruWataya
I don't maintain a blog so my opinion may not count for much, but I feel like if what you are trying to do doesn't fit neatly into an SSG's existing templates/themes, it may in fact be easier just to use pandoc and some simple tooling around it. Certainly when I looked into a few SSGs for the purpose of making a simple personal website (without a blog) I found I would spend more time trying to bend them to my will than just writing what I want in markdown and running pandoc on it.
WorldMaker
Most of them bend to your will very easily if you are the one writing the HTML and not trying to use an existing template/theme. Even Jekyll the "themes" are optional and you can entirely ignore them.
Also most of the complexity disappears if you aren't trying to make a blog. They generally all have "simple pages" support that is much simpler than trying to figure out their blog mechanics.
Of course the hard part is picking an SSG you like, and it is easier to just build your own which is a big part of why SSG proliferation happens. Too many options? Make a new one.
My main sites are still in Jekyll for now, for historic reasons of GitHub Pages support.
My latest discovery and new love in this space is Lume [0]. It's definitely on the simpler side of the scale. I haven't tried it for a full blog yet, but the simple website I have built with it has indeed continued to feel simple throughout the process and even using some of the features Lume's documentation labels "Advanced".
Ugvx
Its the the first time someone has reinvented a static site generator...
Looks around sheepishly
null
alwillis
In my opinion, Jekyll is easier and more capable than Pandoc and markdown files for a HTML/CSS website.
Jekyll also has a higher ceiling than Pandoc when you need a templating language, plugins, etc.
mrweasel
I've tried Hugo and Jekyll a few times and they are pretty complicated. If you just want to post something online every now and then, then it might be easier to just to HTML.
xinu2020
Alternatively pick a light-weight template engine from your favorite language and use it to generate the html. More flexible than plain html files and very low learning commitment.
I've been doing that for years and really happy with the result.
segfaltnh
Did they reinvent or did they learn stuff? Maybe both.
oneeyedpigeon
Another way of looking at it is that Hugo, eleventy, etc. are reinventions of pandoc, makefile etc. The latter things came first!
zahlman
I would rather say that the former group are wrappers around the latter group. Using an SSG doesn't just mean converting Markdown etc. source and orchestrating a build process of some sort, but also filling in templates and providing useful build steps to orchestrate (such as generating additional pages that reference the actual article content: archives, collections grouped by tags or categories, etc.). They also generally implement things like the live reloading that the author mentioned as missing.
I'm currently using Nikola and have done quite a bit of customization - by hacking around and learning modern web stuff as I go (the last time I did this stuff seriously, jQuery was dominant and Bootstrap was brand new - of course I'm not writing a bunch of JavaScript for a blog, but that also presumably dates my understanding of HTML and CSS). I've found that even though there's way more stuff in here than I really want, it's really nice to have that kind of scaffolding to start, and I can strip it away as I customize.
arnath
Yeah, obviously this is literally what something like Jekyll or Hugo does. It's just (at least to me) a simpler version of that where you can fully see what's happening. Also I didn't want all the theme-ing overhead that comes with those - just something I could inject into my existing site.
zahlman
>Also I didn't want all the theme-ing overhead that comes with those - just something I could inject into my existing site.
I didn't like how complex that stuff is with Nikola - I didn't have an obvious entry point for making the kinds of customizations I really wanted, and yet there was still so much to look at in order to understand the system. But at the same time I really didn't want to spend hours re-learning CSS more or less from scratch, when I could actually use the examples already in the existing themes.
I did something really awful: instead of trying to make yet another layer of theme "extension", I copied everything locally and have been condensing it as I go.
This had the benefit that I didn't have to decide on a bunch of CSS classes up front in order to have anything look passable. There may be tons of unused stuff, but I'm cleaning that up as I implement my own things - and bit by bit, I get something smaller and more comprehensible that fits my mental models. This conversion process might not be any faster, but I'm certainly enjoying myself more.
At some point in the future I'm considering doing a simple templating engine and converting these templates (originally Mako) to it. It just irritates me that I still have to deal with close tags - both in HTML and in template directives - when I'm doing everything in Python. I have a vague memory of a 2010-era JavaScript templating system - I think it was called Express or something like that? - which used indent-based syntax without closing tags. So I'm inspired by my recollection of that.
SuboptimalEng
I started a portfolio website with Netlify (iirc), then I moved to Vue + Gridsome (on GitHub pages), then Next.js with Tailwind CSS, and was about to move to Vite.js over winter break.
That's 4 stacks over the course of 5-6 years. Not worth it.
Decided to do the sensible thing and use GitHub's README functionality. I prefer this approach and wish more folks in the tech community adopted it: https://github.com/SuboptimalEng
arnath
This is an interesting idea! Honestly I didn't even know Github had a per-user readme until you mentioned it
zahlman
IMO there's quite a surprising amount of stuff you can do on GitHub that's highly undiscoverable. You only think of it when you see someone else on the site doing it, and then you don't necessarily know what it's called so you don't know how to research it.
bb88
I hate the UI layer, for this reason. Nothing is ever stable. I'm looking for "Boring" and "Googleable in the age of AI slop". The other alternative are frameworks small enough to easily comprehend.
The UI is often tangential to the heavy lifting done by the back end. It often needs to be "just good enough".
eviks
Don’t hate the layer, hate the player.
How can UI be stable if you’re the one changing it all the time even if all you need is a readme page that can be done in the same UI with no change for decades?
dvt
GitHub was just down the other day. Why would you want your personal website/portfolio to be tied to GitHub? Crazy "modern web dev" stacks are likely overkill, but that's not an argument against self-hosting.
sneak
Personal websites can be down a few days a month without a problem.
8n4vidtmkvmk
+1. Not like my $5 hosting plan has less downtime than Github. Well... maybe? Fewer moving parts perhaps. But it's not immune.
mr_mitm
Because it's free and convenient, and other hosting providers don't magically have 100% uptime either. Not even necessarily more uptime than GitHub.
BrandoElFollito
I like to think that when GitHub (or Google, or Netflix, ...) are down, I am not alone.
A few million people are holding their breath - unlike in the case of my self-hosted site where I am alone to bring it back online.
zahlman
How is it "tied"? You still have a local repo that you could deploy somewhere else.
abdulmuhaimin
sounds like a self-inflicted problem really. Why do you even change stack that much if what you want is a simple functionality?
catapart
Good on ya! HTML+JS is plenty performant for a blog and I'm always happy to see more people eschewing frameworks when they're not necessary.
I've been writing a progressive web app that is, itself, a "web component" (custom element), built entirely with custom elements, so I feel like I've got a pretty good idea of how you can tackle that header reuse bullet point. Happy to give pointers if you're interested in that at all.
Anyway, great job on simplifying things! I hope it gets easier from here!
robertlagrant
I think it's rarely about performance and more about organisation. If there's only one developer and it's fairly basic, you neither need the code organising nor state propagation benefits that come with most modern frameworks.
HackerThemAll
The website of one of the most influential IT person, who won the court battle against U.S. Government, allowing for widespread cryptography, professor Daniel J. Bernstein, is and always has been plain HTML mostly with no CSS.
It's served using his own HTTP server - publicfile, and the DNS domain is served using his own DNS server - djbdns. E-mail is handled using his own SMTP server - qmail. He invented the Maildir e-mail format, de facto standard in all e-mail products. All e-mail mailing lists for his products are handled by his own mailing list server - ezmlm. All of this is managed using his replacements to /etc/rc or /etc/init.d or systemd - daemontools.
He invented ChaCha and Salsa stream ciphers, now in widespread use, as well as elliptic curves, especially the famous Curve25519, and the Poly1305 MAC.
He also invented TCP SYN cookies.
Pretty impressive, no?
QuantumGood
These kinds of sites really benefit from "reader"-type plugins, pushing off readability across different interfaces onto the visitor.
jsheard
I'm surprised to not see Astro mentioned, its whole schtick is providing very similar DX to frameworks like SvelteKit except in a way that's geared towards generating plain HTML/CSS with zero JS by default. You get things like components with scoped styles but they are compiled down to nothing. It's really a breath of fresh air.
yawnxyz
Once I randomly discovered Astro, I couldn't go back.
I love that you can even drop in Svelte and React blocks right next to each other, so you basically the power of all the advanced frameworks, and the choice to pare it down to a barebones html static site
null
pantathei
Yep -- I rewrote my blog over new year's with Astro and am pretty happy w easy markdown and a bundle size of zero bytes.
aziis98
Yeah I really like Astro too, I often just start with the minimal template [1] that is just a couple of files. I used to do many experiments with custom SSG some time ago but since Astro came out I can't change back anymore.
If you don't want js on the frontend you can just use it as a nice html templating engine. It also renders markdown automatically for you as it recognizes different formats by the file extension.
[1]: https://github.com/withastro/astro/tree/main/examples/minima...
mplewis
Astro is my favorite tool for static sites these days. It's wonderful.
planetjones
Hugo worked for me. And as part of the GitHub pipeline that builds the site and deploys it I can grab some ‘dynamic’ content (from a Notion DB) and render it. Subsequently I added Zapier so that when the Notion DB changes it triggers the pipeline to update my website. The only thing I pay for is the web hosting with dreamhost.
https://www.planetjones.net/blog/03-05-2023/relaunching-my-p...
erremerre
I have found someone who uses the anchor suffix to solve the problem:
https://john-doe.neocities.org/
I am not html expert, so I have no idea how complicate or what implications would that have.
sira04
This is quite neat. Every page is a <section id="pageid"> and css is
section {display:none}
section:target {display:block}
So they use the target selector which becomes active when #pageid is in the url.
But the html for all the pages is outputted, so this won't scale with a big blog.
I wonder how SEO is for this, and if there's a way to make this better with something like the <object> element.I would also make it so the url was example.com/#/pageid, so the id is "/pageid". Looks a bit better I think.
erremerre
What do you have in mind?
I was thinking in using it for a blog, but I am afraid of having everything in a single file, and that making some mistake will render the whole site useless.
Also not sure how hard would be to manage once it starts to grow... Maybe it needs to grow significantly more than I can before this is a road block.
sira04
I think that would become unwieldy very fast. I think it's alright for a lightweight site like this one with very little content.
If you don't want to use a static site generator I think you're better off with just html files for each page/blog entry, or you could use something like htmx and load stuff in that way.
thro1
Nice one.
Pro-tips: switch styles to show all content (and buttons) then use contenteditable - for the whole page or allow it at element levels, allow copying/removing specific element ("template"), POST new version, HTTP Authenticated, to the server or just save :)
nbbaier
I love this site and concept and have been thinking about moving to this method for my own site
benchly
Same. This would work really well for my site, I think, although I worry slightly about latency as it scales and I add more and more photos. That is not so much a problem right now, but it might impose some latency later.
nbbaier
Yeah. I don't know if it scales to adding a blog either, which I have been thinking about doing.
lapcat
I write my website and blog directly and entirely in HTML using BBEdit. For me, this is just much easier than any other method. I don't have to rely on any external system.
tkgally
Same here. Any text editor would work, of course, but I like BBEdit because of all the customization options. I’ve set up a bunch of shortcuts for frequently used tags; after some practice, I’ve become able to write prose in HTML almost as smoothly as in a word processor.
When I redid my ancient personal site—started in the late 1990s—to make it mobile-friendly a few years ago, BBEdit was also useful when making changes across dozens of files at once.
mikae1
And does your blog have RSS or Atom feed? That's usually where it becomes a little tedious.
lapcat
Of course. It's not a blog without RSS!
Believe it or not, I also manually edit that in BBEdit.
mikae1
I'm impressed, that's grit!
oneeyedpigeon
You just need a build system in place - generating RSS from your collection of html files isn't difficult.
wvenable
I also decided to develop my personal website in plain HTML. I looked into a bunch of static site generators and found that direction to be too complicated and slow for me.
I still wanted the ability to have a common headers and footers and unique sections without repeating myself in every file. So I created a very small PHP application (just 5 files) and each page or blog post is a single PHP file in a directory. These PHP files have a small bit of metadata code at the top but are otherwise just plain HTML files. In each directory is layout file that wraps the content and these nest up the directory structure. So my site has a common header and footer and each section has their own subheader.
With the ability to publish by git push to the server, writing a blog post is as easy as creating a new file, git commit, and git push.
Brajeshwar
If you OK using a tiny tad JavaScript, it should be able to re-write that portion of the DOM to have HEADER and FOOTER common. Nonetheless, if you are also OK using Github, it has built-in setup where you blog in Plain-text (MarkDown) and things just works. You don't even need to build it on your local machine.
I wrote about it when I moved from WordPress to Jekyll. https://brajeshwar.com/2021/brajeshwar.com-2021/
numpy-thagoras
Hugo is also nice for this, and allows for markdown, embedding Mathjax or LaTeX, etc. Your minimal approach mirrors some of what I've seen in Hugo or Astro, and I'm all for it. I wish we had truly minimalist SSGs, I think the idea has a lot of purchase.
I've been maintaining my personal website as plain HTML for five years now. I must say, I quite like this method. There's no substitute for practice when it comes to maintaining your skills at editing HTML and CSS.
Yes, you must copy and paste content and not having layout page is annoying at times. But the overhead of just doing it yourself is surprisingly small in terms of the time commitment.
Typically, I'll draft a post in MS Word then open the git repo for my site, hosted on github pages, duplicate and rename the template.html page that includes the CSS, footer, and header for my site and then copy my content into it. When I'm happy with everything, I'll make my commit and then a minute later it's live at my custom domain. Seeing that it takes only 11KBs and 26ms to load my landing page strangely delightful.