I never thought of that as an option. Thanks for the tip haha.
215 karma · joined January 2, 2013
I never thought of that as an option. Thanks for the tip haha.
However I never got around to finishing it, mainly because I couldn't decide on where to stop: should I also generate commits from all non-master branches etc.
I flirted with the idea of a browser-side repo viewer too, but re-implementing git packfile parsing in js didn't seem like something I'd want to spend my time on, so I moved on. Glad to see others pondering the same thing though.
Not the most original of ideas, but I was really sold on djot [1] and wanted something less fussy than pelican [2], so it just happened.
That's what the outer min() is for: it makes sure the font size caps out at 1.3em which usually translates to 16 x 1.3 = 20.8px, which is well within the recommended size range for prose anyway.
What that whole snippet does boils down to exactly what they said in the article:
> The main global stylesheet uses the browser default font size, smoothly scaled up to 130% on higher-resolution displays as the baseline for the body text of the whole document.
On a low-dpi screen, nothing changes. On a high-dpi one, if you haven't set your browser text size to something larger, this snippet saves you from tiny unreadable text. Also note that ctrl+ and ctrl- to zoom still work just fine. It's not as dramatic a change as the sibling comment said. You can try it out on their site to see for yourself.
> Websites in the, (late), 1990s were characterised by many things, but a typical list might include:
> - Serif fonts
Thanks for the tip on clamp() by the way, TIL.
font-size: min(max(1em, 1.3vw), 1.3em);
Which explains why it looks just right on my high-DPI Chromebook even though I haven't configured a big enough default font size for the browser.This is going to be the default font-size for all of my websites now (preceded by a fallback for maximum compatibility of course).
[1]: https://www.cyberciti.biz/faq/linux-unix-apple-osx-bsd-rsync...
It's closer to this. The actual content was already written to an sqlite db, and my read-only FS allows reading that data back out but as a filesystem.
The admittedly not that interesting (and probably bad - I'm new to Go) code is here[1], and this "BlogFS" is used in 2 places:
- During "export" where it generates the static site. "Folder A" is my FS and "Folder B" is the destination i.e. an actual folder on the real filesystem.
- In a preview server that just serves "Folder A" directly.
[1]: https://git.sr.ht/~nhanb/bloghead/tree/40b70cadb01c14f1e3bf5...
For example, I have been developing a static site generator where I implement the output folder as an fs.FS[1]. The output generating code is now a simple function that copies from folder A to folder B, without even knowing that A is a virtual filesystem. Now how do I implement a preview server? Simply pass said filesystem to the standard library's http.FileServer. Done. (okay you actually have to pass it through the http.FS() adapter, but that's only because http.FileServer predates io/fs)
Of course this kind of abstraction can be done in any language, but Go explicitly specifies this interface, which can already be used by multiple utilities in the standard library (e.g. http.FileServer, go:embed). This nudges people to the same interoperable interface, and I'm all for it.
[0]: https://www.youtube.com/watch?v=yx7lmuwUNv8 [1]: https://pkg.go.dev/io/fs#FS
Seems like there's not much activity lately either [2]
[1]: https://github.com/appjs/appjs [2]: https://github.com/appjs/appjs/commits/master
What if you want to add a new element at the top? And even when you need to add it at the end, if you use a decent editor, it won't make a difference. For example, with vim:
(Place cursor on last element) A,<cr>myNewElement
As opposed to left comma style: o,<space>myNewElement
Only 3 extra keysrokes for both cases. (<cr> is the Enter key, by the way)
I can't believe this kind of post could make it to the front page of Hacker News.