Live data from Hacker News

How to build a website without frameworks and tons of libraries

kodingkitty.com

261–270 of 270 posts

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

#261

Earlier quoted context omitted.

If the http server supports it and it is enabled, you can do Server Side Includes https://en.m.wikipedia.org/wiki/Server_Side_Includes

Even better - Edge Side Includes: https://blog.cloudflare.com/edge-side-includes-with-cloudfla...

Even better better just or even

Functionality should be considered based on potential utility. Not sure what politics are involved at the w3c, but if it's not that, then maybe it's their philosophy and approach that has them not going for that which is most useful.

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

#262
post #159

Earlier quoted context omitted.

SvelteKit is amazing. I disagree about Skeleton though. Skeleton makes you feel productive and safe at first but it has a lot of foot-guns. It leads you down a happy path until you don't like something and then it's difficult to customize. You're much better off using DaisyUI or something headless like MeltUI when it's ready. Take a look at Skeleton's own site https://www.skeleton.dev/docs/get-started Press page down…

This is good to know! I’ll try out DaisyUI next! My favourite part about skeleton has been having mostly functional, pre-existing component classes. The svelte material ui (smui?) library left a lot to be desired there, and I like how easy it is the modify the skeleton ones, since they aren’t a horrible jumbled mess of tags like all of the Vuetify components are below the surface. My least favourite part of tailwind…

Very happy DaisyUI user here. While I like tailwind, I have to agree that for simple things like buttons as mentioning above, it sure is verbose. One of the best aspects of DaisyUI is the wealth of ready-made elements that have very reasonable defaults which often need very little to no tweaking. Of course, you can adjust them as needed very easily. Since we’re on the topic let’s complete the stack: Using DaisyUI and a small GoFiber.io server running Go stdlib HTML templates, I’m able to crank out high performance web apps with minimal fuss. By using the embedding feature in the Go compiler you can ball everything up into a single deployable binary. For in-page interactivity, I like htmx and/or AlpineJS, depending on the use case. No NodeJS dependencies in sight!

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

#263

Did anyone else notice the fact that on the home page, for any window width >= 1280px, the text "Your design. Our HTML and CSS" (in the body) overlaps the text in the footer (and is strangely hard to select for copying to the clipboard). In fact the footer tends to overlap the body at various window sizes. Can't help but think that you'd wanna at least get a simple thing like that right on such a page... Edit: I noti…

Guess it wasn't just my system, they've since fixed this. Though at the cost of the footer never being visible without scrolling now (even at ~2100 x 1080 size).

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

#265
post #227

Hetzner is the hands down best cloud/infrastructure provider for the quality and price both but for a static website, spinning up a cloud VM is far from minimal. You need lots of setup, a web server and web server configuration. That too when far minimal options like Cloudflare Pages exists that are dirt cheap as well and is somewhat "serverless".

[dead]

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

#266

Earlier quoted context omitted.

You could use server-side includes to get the basic prev-next navigation and consistent menus, headers and footers.

I moved from static HTML to 11ty ( https://11ty.dev ) for the same reason and I'm pretty happy with how simple it allows you to keep things. Plus, it helps me avoid yak shaving instead of writing content! I think for a site like this I'd go with 11ty, just a clean project without a template or custom config, one collection to pull the photos from Flickr inline the styles. (just sharing my personal approach, nothing w…

Thanks for the link.

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

#267
post #216
post #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 mo…

Honestly if the goal is a website as simple as possible, dark mode should not belong there at all. We've had simple readable websites in 90s long before the dark mode fad was a thing, only having light mode is fine. > 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-mod…

'Simple' is always relative to requirements. Otherwise, you'd just be sending 80-col ASCII textfiles down the wire (or something even simpler than that, like nothing at all).

Is dark-mode a good requirement? I'm not sure. It's nice to have, and our dark-mode does look great on a recent smartphone in the dark - but if I had known just how hard a good dark-mode would be, and how many of the issues we would struggle with (issues which OP runs headlong into), I think we would've skipped it. There's a lot of other things that time & energy could go into.

For most websites, I would say that they have far too many problems to spend time on dark-mode, no matter how trendy dark-mode is. (Users who really want dark-mode can install one of many extensions/plugins/apps/screen-inversion tools. They work reasonably well, and usually avoid issues like the white-flash FOUC.)

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

#268
post #231
post #211

Earlier quoted context omitted.

You don't need to hide the entire page until fully rendered. You inline in the head just the bits of CSS/JS you need and set styles from there, so if you are in dark mode, it's set to dark before anything has rendered, without needing to block a huge amount of time. You can see how it works on my site https://gwern.net/ - set dark mode in the toggle (assuming it is not your system setting already), and refresh or for…

On mobile safari the little Control Strip at the bottom doesn’t appear after the first couple of refreshes. I can see it try to slide up then it dies.

The idea there is what we call 'demo-mode', a new feature to try to enable helpful chatty features but for only _n_ page loads. So the full theme toggle (or Control Strip in Mac terms) is exposed on the first page load, but then is left collapsed into the gear on subsequent page loads to reduce clutter.

I don't think it should 'try to slide up then it dies'; do you mean you can't see the gear at all?

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

#269
post #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 mo…

I was reading this thinking "that's a great analysis" and then read _who_ posted it. OP, this is the author of https://gwern.net , which has been very influential in the design of many technical blogs / personal sites and has some very inventive and fantastic ideas. Ie, the author knows what they're talking about. My site uses CSS to respect light/dark theme, so has no manual toggle. It requires Javascript and I have…

That's very flattering. So I'll relay some comments on your site:

- you make sentence-spacing a major design goal. I looked into that a bit ago and I found little or no real evidence that sentence-spacing is a good idea (https://gwern.net/doc/design/typography/sentence-spacing/ind...) and it would be expensive to implement: you do the only reasonable thing of injecting s... but oh so many s. If you get long pages like mine, that is going to cost you - DOM nodes are not free, soldier! - one issue with sentence-spacing is that you are fighting HTML & CSS the entire way. They just do not want to do it. You correctly note that it's hard, but you accidentally demonstrate it's even harder than you thought: you have justification enabled but not hyphenation... so all that happens is that sentences get stretched out to make them fully-justified and you get large double-spaces everywhere! Your current implementation winds up being not so much 'sentence-spacing' as 'every few words spacing'. (This is especially glaring in the sidenotes, like on the page I'm looking at right now, 'Stephen Zamadics' looks like 'Stephen_________Zamadics'. Since you set the column narrow, you probably want good hyphenation too... perhaps server-side, if you're deadset against JS.) - Dropcap positioning is hard, especially if you'd like it to work on more than one browser, and I'm not surprised yours has problems; pretty much everyone screws those up. (At least, I assume you don't intend the positioning problems like the '1' almost overlapping the 'someone' in cases like https://daveon.design/creating-joy-in-the-user-experience.ht... .) - I think the dotted underlining is too hard to see: much too small and close to the link. Are you sure you don't need `text-decoration-thickness: from-font` & `text-underline-position: from-font`? - Rubricating the entire sidenote on hover seems excessive. - Sidenote numbering is very confusing. They get numbered 1/2/3/4... and then all lose their numbers in favor of ''? Mixing numbered & unnumbered is confusing enough, but then transitioning at the utterly arbitrary '5' let me baffled and wondering if the ''s were supposed to be a separate kind of sidenote like a margin-note. Definitely a case for 0/1/infinity. - Sidenotes come off as cluttered and hard-to-read, at least partially because they are all 1 big paragraph. Breaking them up would increase readability. I hope you didn't inherit Tufte-CSS's unnecessary and artificial limitation to non-block elements...? (I can't believe they refuse to fix that.) - EB Garamond is a variable font, which is a bit of a questionable choice because OS+browser support is still relatively low. (Just browser-wise, it's only at ~95% global https://caniuse.com/?search=variable%20font so add on OS incompatibility... The text should still render, but it won't look like you expect it to. Example: https://share.obormot.net/screenshots/Arcturus_Screen%20Shot... Also shows the sentence-spacing problems & dropcap problems.) - The use of auto-smallcaps (after H1s, I guess?) winds up feeling busy and confusing. Look at a page like https://daveon.design/about-dave-on-design.html where the sections so short - it winds up feeling like smallcaps is just being sprayed around at random, and the logic is lost. - Your image dragging widget is mysterious. The icons are unfamiliar and so small that they signal non-interactive. - am I imagining it or are your -asterisk-thingies weirdly offset to the right? - The lack of any header or obvious site navigational apparatus, despite the very large header, makes the site feel somehow cramped and confining. You must like your tree - have you considered the classic HTML approach of an image map? - The use of triangles in the ToC is a bad idea. They look too much like collapse/disclosures, which are becoming increasingly common, especially in ToCs like this, especially when the reader has already seen you use black-dots for unordered list markers. - Easter eggs like `X-Clacks-Overhead` are fine, but the page should still validate... (Doesn't look like a legal http-equiv to me: https://html.spec.whatwg.org/multipage/semantics.html#attr-m... ) - You have low-hanging fruit in performance and can definitely render faster: https://pagespeed.web.dev/analysis/https-daveon-design-about... - Tooltips, tooltips, tooltips!

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

#270

Maybe I'm misunderstanding, but this doesn't sound all that different from your average static site generator—Python-based Jinja templating for HTML files versus Ruby-based Liquid templating for HTML/Markdown files (i.e., Jekyll).

I was thinking the same thing. If the author's goal was simplicity, it seems like a strange choice to forgo using an existing SSG only to build a bespoke one on their own.

A PHP site (for the includes), or an out-of-the-box SSG would make much more sense, IMO.

Post reply on HN