Live data from Hacker News

How to build a website without frameworks and tons of libraries

kodingkitty.com

1–10 of 270 posts

Re: How to build a website without frameworks and tons of libraries

#4
I took a similar approach building mailpace.com's marketing/landing site: https://blog.mailpace.com/blog/using-html-modules/

basically you just write in HTML, CSS and a wee bit of JS wherever you want it, and have a couple of tiny npm scripts that glue it together.

Put it on netlify, cloudflare, github, or wherever and it scales right up.

In comparison our blog is in Gatsby, and boy does that framework never seem to work right away when we start it up for adding a new post.

Re: How to build a website without frameworks and tons of libraries

#5
Nice, it’s always interesting to discover blogging stacks.

Historically a blog requires a feed, this is typically where super minimal stacks stop, although I guess you could scrape your index.

I wonder how many web devs can still build a blogging app, a webshop, etc from first principles when mostly it’s all npm create packages and template languages.

I started a php / SQLite blogging stack with basic web based editing and a feed (ah and tagging, a search), hope to add more indie web features to it.

Re: How to build a website without frameworks and tons of libraries

#6
post #3
post #2

It may not have a zillion libraries, but surprised that a site trying to be zippy uses low-contrast text (obviously, I am not a fan of the "increases engagement time" school of thought).

It's pretty readable at their large font size

Agreed. I feel like I'm always the first in my company to complain when someone proposes a too-thin or too-light font style or color, but this read fine for me. I'd move away from monospace if anything, but I take that as a stylistic choice they made even if it hurts readability a little (not like thin gray that's used without even noticing: the dev already knows what's written there, or doesn't care if it's lorem ipsum, and checks the font only for form instead of also for function).

Re: How to build a website without frameworks and tons of libraries

#7
post #3
post #2

It may not have a zillion libraries, but surprised that a site trying to be zippy uses low-contrast text (obviously, I am not a fan of the "increases engagement time" school of thought).

It's pretty readable at their large font size

Is that a condemnation by faint praise? :)

Could be because I'm reading on desktop and it works better on mobile.

Re: How to build a website without frameworks and tons of libraries

#8
Simple static sites are great ideas. Writing HTML/CSS and not relying on a WYSIWYG back-end editor is an awesome way to work, especially if you're using a templating engine to generate the static content as mentioned here. However, in my experience the people paying to have websites built or your in-house marketing team maintaining and updating the company website, making sure the SEO is up-to-snuff, etc. can't do these things. They don't want to learn how to do these things. The unfortunate truth is that more times than not they require Wordpress or something like it to do their job.

Re: How to build a website without frameworks and tons of libraries

#9
post #7
post #3

Earlier quoted context omitted.

It's pretty readable at their large font size

Is that a condemnation by faint praise? :) Could be because I'm reading on desktop and it works better on mobile.

I'm on a laptop and it looks totally fine to me.

Re: How to build a website without frameworks and tons of libraries

#10
This seems to fall into the 'simplistic, not simple' school of thought. You can have a relatively simple website if it doesn't do anything and if it cuts corners.

Take your dark mode, which is just about the only nontrivial feature I see on this page. (One could also criticize the low contrast of the appearance and other problems, but that's less relevant to the simplicity thesis you're claiming.)

First, your dark mode is implemented wrong in the lazy corner-cutting way of doing JS post-load instead of the correct way of CSS body classes; so you get the 'flash of white' unavoidably on every page load - just what every dark mode user with their phone to their face at midnight wants to see! (If your solution doesn't work, it doesn't matter if it's 'simple' or 'complex'.)

Second, you implement what is like 3 lines of JS (setting localstorage & dark-mode) by pulling in what looks like an entire interpreter for a custom 'hyperscript' https://hyperscript.org/ language which seems to mostly just offer some sugar over JS; now, maybe you use 'hyperscript' elsewhere for reasonable purposes, but surely pulling in a 96kb (uncached) library solely to run

def saveMode() if first classList.value of contains 'dark' set localStorage.kkColorMode to 'dark' else set localStorage.kkColorMode to 'light' end end

  init if localStorage.kkColorMode is empty set localStorage.kkColorMode to 'light' end if localStorage.kkColorMode is 'dark' add .dark to  end
is a bit against the spirit of this "simplicity is the ultimate perfection" enterprise...? Personally, I feel like I see some easy perfection to add right there. (And is this hyperscript stuff also why the HTML doesn't validate?)

Third, this binary toggle is a bad way to implement dark mode because it ignores system/browser settings, so if a user has, say, enabled dark-mode on their smartphone OS, they still get served light-mode until they manually enable it; note that some systems change it based on local time/ambient light too, which is quite nice... if websites & apps respect it instead of overriding it. And since localstorage expires and users switch devices, they would have to do so repeatedly. Is this a good thing? A user probably would disagree with the developer who is touting how 'simple' the dark-mode implementation is because they cut corners in handling system settings/auto-dark-mode...

Post reply on HN