Live data from Hacker News

My stack is HTML+CSS

blog.steren.fr

181–190 of 194 posts

Re: My stack is HTML+CSS

#181

Earlier quoted context omitted.

> To be fair, static site generators are a thing There goes your super-lean stack and we're back to square-one.

If you know what you want you could write a trivial script which just pushes a Markdown file through pandoc(unless you just write html), concatenates it with the files for the header and footer (& maybe an inlined stylesheet) and appends a link to the index file. The result will be the same but applying changes on all pages is a matter of seconds. Nothing against a lightweight stack, but simplicity doesn't necessaril…

This was essentially my first blog.

Re: My stack is HTML+CSS

#182
post #72
post #66

Sure, it's super easy when your page doesn't have even a header and/or a footer. Try having a top-menu in your design, or some banners/ads, and then you need to change ALL the pages to change a single url. This is how we used to do things long time ago, and it sucked BIG TIME, and that's why people invented server-side includes and cgi and mod_php and all of that... it saves time, and your time costs much more than h…

My article covers that: > So... if I don’t use any templating system, how do I update my header, footer or nav? Well, simply by using the ”Replace in files” feature of any good text editor. They don’t need frequent updates anyway. The benefits of using a templating system is not worth the cost of introducing the tooling it requires.

"Tooling" can mean many different things, it can be an over-engineered flow including a dozen of different tools, or it can be a few custom made scripts to glue together html for you... but anyway, it's one time setup, you invest 2 hours of your life once and if done right it can happily run your site for decades, plus if you did it before it's no brainer usually... hell, I even have some old wordpress sites that I haven't touched in 10+ years and they autoupdate and work just fine, even make a few bucks here and there (but it certainly helps a lot if one knows what they're doing when making the sites).

Re: My stack is HTML+CSS

#183

I'm also a huge fan of keeping things simple. But there is a reason we are having this conversation here, and not in the comments section of his blog. Comments are something I consider pretty vital to even a basic blog now. And so he's kind of missed the mark for me.

Comments used to be almost table stakes, but in the last decade or so, things have shifted so that I estimate that only somewhere around 5–20% of the blogs I encounter have them.

Re: My stack is HTML+CSS

#184
post #161

Earlier quoted context omitted.

Removing the dimensions from the image tags is absolutely the wrong thing to do. If you do this, then a browser/user/client that wants that information simply doesn't have it - you can't create bits from thin air. If you leave the metadata in, then any browser that wants it can use it, and any brower that doesn't want it can ignore it. I can code up a Greasemonkey script in a few minutes that will strip the width and…

They do, you can read the size data from the image file itself before you render it

They do not.

The width and height attributes we have been discussing set the size that the image will be displayed at, which are not necessarily the size of the image transferred.

Those are two very different things. My statement holds - if an image has size (a, b), but the author wants it to render at size (c, d) but does not send that data, the client has no way of magically determining c and d.

Furthermore, even when the actual image size is the same as the width and height attributes, there's the obvious problem of you needing to completely transfer the image itself before determining the size, which blocks rendering (or forces you to re-compute layout a second time, which both increases latency and decreases throughput).

Re: My stack is HTML+CSS

#185
One thing I'd like to learn/better understand is this part:

{ "@context": "http://schema.org", "@type": "Article", "author": "Steren Giannini", "name": "My stack will outlive yours", "image": "https://blog.steren.fr/2020/my-stack-will-outlive-yours/ligh..." }

is this something created programmatically? I'd like to create a blog but I don't want to have to type all all the necessary schema.org tags myself. Any ideas here?

edit: God, I can't even get this text to format properly. I'm such an idiot.

Re: My stack is HTML+CSS

#186
post #114

Earlier quoted context omitted.

He mentions that SSGs require tooling and dependencies. And if all you need are dynamic headers and footers, just wrap those in 'php include' tags and rename the files to .php. It's still HTML and CSS that's getting rendered.

I’m not a web guy—- this should be safe from php vulnerabilities I would think, because there is no db and it’s just taking advantage of very limited/basic features of php right?

The number of vulnerabilities is vastly reduced due to the static nature of the site. You aren't buying anything on it, or inputting other kinds of data that needs to be written to a database. It may as well be a read-only site.

Re: My stack is HTML+CSS

#187
post #169
post #168

Earlier quoted context omitted.

> now standard "infrastructure as code" [...] check in a spec for a container (Dockerfile) into VCS This is an example of the "predilection for certain systems and ways of working" that I referred to. > it also tends to rot (who hosts that? Are you limited to PHP? Are you upgrading PHP? Did that company get sold?) That's not really what I meant. My reference to WordPress was probably more misleading than I intended.…

Hm I think we're coming at this from different angles... the whole "SOP" terminology confuses me, though I guess you mean "standard operating procedure". I'm a programmer so when I hear "document on how to update something" I hear "untested set of manual steps". I don't understand why it isn't a shell script instead ... ---- I actually don't want to preserve an authoring experience forever. I expect that my authoring…

> when I hear "document on how to update something" I hear "untested set of manual steps"

Why "untested" and why "manual"? I mentioned "detail" and "rigor" more than once and that it's possible to take it and feed it into a machine that will "perform those steps automatically".

I don't think kernel+shell are all that timeless of an interface to write to. They only barely pass for being portable in the here and now. (Oilshell's existence as a project is a testament to that. Its breadth and the depth of the pitfalls it has to avoid is another one.) Most of the time portability is an illusion that comes from most people around a given project being part of the same technological subculture, so they happen to use a common implementation. When you stray outside of that is when you run into breakage that no one is otherwise aware of. See also https://pointersgonewild.com/2019/11/02/they-might-never-tel...>.

> I don't quite understand what you are getting at so I think you must have a much different use case [...] It seems like you might be talking more about a blog that lots of people are editing?

Nope, the use cases we're talking about are the same. I don't know where the lots of people editing parts comes in.

What I'm talking about is conceptually very simple (maybe too simple, leading to an assumption that there's a lot more to it). It's a document that describes in detail, just like any other tech spec, precisely how to process a given input and turn it into a directory of static resources that you are used to dealing with, i.e., the output of a static site generator. The only difference between it and other specs is that in this document you specify things with enough rigor that you can effectively "execute" the specification itself. I've heard Rob Pike say in a few talks that some of the Golang backends come from a tool Ken wrote where they can feed in PDF manuals from microprocessor vendors and get a working Go assembler out of them, but I'm not intimately familiar with that tool. See also http://www.moserware.com/2008/04/towards-moores-law-software...> where some RFC-style diagrams constitute a part of the implementation of a working TCP/IP stack.

> If you have an example then that would help.

I might do a short (? I'd hope) screencast next weekend if you're interested in providing some feedback. Asynchronously and pre-recorded, not live. My first assumption is that when you see what this is all about, then you're going to be pissed off. Based on your description of your current setup, though, that impression may not be accurate.

> Apps are the things that rot.

This is where my comments about "predilection for certain systems and ways of working" and how "we've missed the obvious and have been doing it all wrong" come from. In trying to solve these problems, there's way too much emphasis on apps, CI configurations, or whatever mindtrap is ensnaring people at the moment. The "obvious" approach I refer to is first adopting a mindset where it's an imperative to include a functional specification as described. I.e., add it to the set of things that you intend to publish on your site. Once you do this, it's hard not to notice that there's now an overlap between your data and the "app" you're using to publish it. So the second thing to do is to eliminate the part that's most susceptible to rot.

Re: My stack is HTML+CSS

#188
post #187
post #169

Earlier quoted context omitted.

Hm I think we're coming at this from different angles... the whole "SOP" terminology confuses me, though I guess you mean "standard operating procedure". I'm a programmer so when I hear "document on how to update something" I hear "untested set of manual steps". I don't understand why it isn't a shell script instead ... ---- I actually don't want to preserve an authoring experience forever. I expect that my authoring…

> when I hear "document on how to update something" I hear "untested set of manual steps" Why "untested" and why "manual"? I mentioned "detail" and "rigor" more than once and that it's possible to take it and feed it into a machine that will "perform those steps automatically". I don't think kernel+shell are all that timeless of an interface to write to. They only barely pass for being portable in the here and now. (…

The only difference between it and other specs is that in this document you specify things with enough rigor that you can effectively "execute" the specification itself

Hm if you have a concrete demo then sure I would watch it and give some feedback. (e-mail in profile) It sounds like literate programming for a shell script to me :)

The kernel + shell is the best we have, since there are multiple implementations going back years. For example FreeBSD and Linux are totally separate projects and codebases, and implement a very very large common subset (POSIX, which has absolutely everything you need for text processing and document authoring).

For example, I just tried out NearlyFreeSpeech, a very inexpensive pay-as-you-go hosting service, and I found it runs FreeBSD. If I really wanted to make my blog portable and timeless, I would port it to NearlyFreeSpeech, which I estimate would probably be one day of work (really, I only use the Python stdlib, etc.). But I'm comfortable enough that Linux is going to survive until in some form or another until I'm dead ... or if it doesn't, there will be some migration path for the bazillions of other users.

The point is multiple implementations: Unix has multiple implementations, CommonMark has multiple implementations, and so does HTML/HTTP. Those things aren't going away.

The reason that Spolsky's blog rotted is because he built it in a custom tool (which he wrote), which was built on VB6, which was built by a company which changed its strategy ... etc. The stack was too high, and too proprietary.

He switched to WordPress, but I'd argue that stack is too high too, even though it's more open source.

So I'm happy with my solution but sure I would look at different ones. But my feedback might be that it should be "tested" in the real world. Just like the HTML+CSS solution is NOT tested because the OP didn't actually write many blog posts with this toolchain!

Re: My stack is HTML+CSS

#189
post #16

While I really like the idea of serving raw HTML and CSS, I think that on the authoring side, a static site generator that ingests Markdown and generates HTML is a more practical way to go. I think writing raw HTML can work fine for small pages, and arguably it can be better than Markdown for pages with a lot of design elements, like landing pages. But for the typical blog post, or especially if the blog post has cod…

I don't like Markdown, because it too often takes what I meant and changes it to what I think I meant. I'm OK with ambiguity between implementations, but this one is a deal-breaker for me, and I've not encountered a Markdown implementation which doesn't do it. I think it's just a faulty idea to begin with.

Perhaps you should take a look at https://asciidoc.org/

Re: My stack is HTML+CSS

#190
post #66

Sure, it's super easy when your page doesn't have even a header and/or a footer. Try having a top-menu in your design, or some banners/ads, and then you need to change ALL the pages to change a single url. This is how we used to do things long time ago, and it sucked BIG TIME, and that's why people invented server-side includes and cgi and mod_php and all of that... it saves time, and your time costs much more than h…

Just create the header/footer as static SVG, embed as , let http/2 handle the rest.

Interesting. Can you share an example of this working?
Post reply on HN