1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-15 01:42:10 +00:00
Commit graph

848 commits

Author SHA1 Message Date
Rohan Kumar
6223768f04
Makefile: zopfli-compress the webmanifest as well 2020-12-18 18:32:55 -08:00
Rohan Kumar
03da61c393
Remove redundant CSS selectors
Thanks to YellowLabTools for pointing that out
2020-12-18 18:30:34 -08:00
rohan kumar
347b2c189b
Greatly simplify CSS, dark theme fixes
- Changed: Make all color codes 3-char. Shave off a few bytes.
- Removed: all responsive layout besides the navigation links.
  Everything else should work well at all window sizes without making
  allowances for special cases.
- Removed: redundant CSS rules
- Added: centered images. Left-aligned images in a center-aligned column
  of text break flow.
- Added: dark mode link colors for visited/active. Active link colors
  give better a11y.
- Fix: don't show unnecessary scrollbar for <pre> blocks

Also put more comments in the source to explain why each rule is
important.

All this shrunk the CSS from 1065 bytes to 882 bytes (17% reduction)
2020-12-17 21:27:11 -08:00
rohan kumar
e8f31f9f08
Adjust text width/responsiveness
- Text width was too wide on wide screens; reduce it.
- Make the nav-links' responsive layout for narrow viewports trigger at
  a narrower window size. It used to trigger at 600px, but I made it
  trigger at 32rem instead since the nav links aren't too wide. This
  also handles cases where users' default sans-serif fonts are very
  wide: rem measures by character width instead of pixels.
- Make the narrow-optimized multiline-navlinks the default, and make
  widescreens a special case detected with a CSS media query.
  Previously, widescreens were the default; however, this meant that
  browsers that didn't support media queries (like dillo and netsurf)
  couldn't switch to the multi-line navigation at narrow widths. This is
  a good example of progressive enhancement; modern browsers will get
  the same behavior as before, but the lowest common denominator will
  see a better experience.
- Don't further reduce the max-width for narrow screens; narrow screens
  are already narrow. We now have one less CSS rule.
2020-12-17 11:23:37 -08:00
rohan kumar
6ac7e6d3a8
Make: skip gzip-static, add check-links to test
- Don't compress build assets unless we're building for deployment
- Inclue link-checking in "make test"
2020-12-16 19:01:58 -08:00
rohan kumar
3368f8fea9
Update web best practices article: add testing
- Add information about testing edge cases
- Re-word some long sentences
2020-12-16 18:53:24 -08:00
rohan kumar
59bc793152
Asset organization
- Use the recommended resolution for the open graph image
- Since the mask-icon is onl served as a cache-busted asset and never
  served as a plain link from the site root, move it to assets/
- Cache-bust the webmanifest and put it in assets/
2020-12-16 13:19:32 -08:00
rohan kumar
638cb80ed3
Fix robots.txt 2020-12-15 23:14:09 -08:00
rohan kumar
d45926c0f4
CLS: Declare original image dimensions in HTML
Reduce Cumulative Layout Shift (CLS) by declaring original image
dimensions in HTML before re-scaling with CSS. This tells browsers the
image's aspect ratio before the image and the stylesheet load, allowing
browsers to block out space accordingly to avoid making elements "jump"
during loading.

More info: https://web.dev/optimize-cls/
2020-12-15 23:09:45 -08:00
rohan kumar
af6ece0e10
Add some more metadata for widgets + indieweb
- Add open graph metadata for other apps to display link previews
- Add more rel="me" metadata for the Indieweb. Getting on the Indieweb
  will take some time, but this is a good first step.
2020-12-15 23:05:45 -08:00
rohan kumar
b9a307a8c1
Icons: add the final icon: maskable icon
I just found out that lots of Android devices will letterbox icons; the
latest version of Lighthouse will preview an icon in the safe clipping
range, and that range was way too small for my existing icons. I made a
new version that was mask-safe with the white foreground shrunk down a
bit so it would fit. See [0].

[0]: https://web.dev/maskable-icon-audit/

For consistency, I renamed the Apple mask icon as well.

Why are there so many extensions to the HTML standard for icons? This is
getting ridiculous.

It's time for a rant about icon standards. Let's recap! what icons do I
have so far?

- A 192px apple-touch-icon. Apple icons are supposed to be 180px, but
  192px gets re-sized down just fine. This used to be apple-specific but
  then Android and others started using it. I picked 192px instead of the
  standard 180px because we need...(next bullet)
- A 192px icon for Android devices. Rather than having a separate icon
  for this, I just re-used the existing Apple icon in case the user's
  browser wants both so it can just cache and re-use it.
- The original 32px favicon.png. I picked PNG instead of ICO because an
  ICO containing the optimized PNG was a whopping 2kb while the png was
  176 bytes. It looks fine when scaled down to 16px with a variety of
  automatic downscaling algos, so there was no need to include an extra
  16px version.
- A mask-icon. I was hesitant to implement this since it seemed very
  vendor-specific (desktop Safari only), but it somehow became an
  accepted registered extension to the spec [1] so I figured that it was
  only a matter of time before a bunch of other things started using it.
- A webmanifest file to describe even more icons. It re-defines the
  aforementioned 192px icons. I chose to re-use the icon for the same
  reason as before. It also describes the next two bullets:
- favicon.svg: used in the manifest in case the device wants something
  bigger than 192px.
- A maskable icon (svg), completely unrelated to the aforementioned
  mask-icon, with the focus of the image shrunk down to handle cropping
  e.g. on some Android devices.

[1]: https://html.spec.whatwg.org/multipage/semantics.html#attr-link-sizes

What I SHOULD have, in an imaginary world where web standards make sense:

- A 32x32 raster icon. Probably PNG, but lossless-webp migth work
  too.
- A 16x16 raster icon, only if the 32x32 version doesn't downscale
  well.
- An svg icon for any other resolution.

What I don't, and probably never will have:

- A msapplication icon for IE 10 on Windows 8.0, for adding sites to the
  Windows 8 Start Screen.
- A browserconfig.xml in my site's root directory for adding sites to
  the Windows 8.1+ Start Screen/Menu with custom icons.

Since MS dumped IE and switched to Edge, documentation for the above was
never updated. I don't run proprietary operating systems, so I can't
test adding a website to the tiled Start Menu or Windows Task Bar.

Now that MS re-wrote Edge as a Chromium-based browser, I really have no
idea how it handles icons; I'd imagine it just does what Chrome does,
but it probably does some odd witchcraft to support adding sites to
Start or the taskbar. Docs don't seem to exist. Until they update the
docs, I'll assume that adding MS icons would mean supporting a
non-standard IE-specific feature.

Due to its simplicity, my site should render fine in browsers going as
far back as IE5; it even works in KHTML. But there are some lines I
won't cross: it'll probably *render* on IE5 but it won't *load* since
https://seirdy.one is TLS 1.2/1.3 only. And it won't support special
proprietary non-standard extensions.

WTF we're almost at 80 lines. I should've just written a blog post.
2020-12-15 14:34:32 -08:00
rohan kumar
8af072a0be
Remove SRI for icons
Apparently SRI is only valid for rel attrs with the value "stylesheet",
"preload", or "modulepreload".
2020-12-14 23:05:08 -08:00
rohan kumar
337e34739f
Move link-checking and browserslist out of hintrc
- Use lychee for link-checking
- Move browserslist to own file
2020-12-14 22:12:52 -08:00
rohan kumar
19520825bb
Icons 2: electric boogaloo
- More sizes
- webmanifest file for even more versions
- symlink icons instead of copying them; fewer binaries in the repo.
2020-12-14 22:11:33 -08:00
rohan kumar
8edc6bedb6
CI: Fix: forgot to update rsync flags
- Add --delete flag
- replace "public/" with "$(OUT_DIR)"
2020-12-12 22:07:00 -08:00
rohan kumar
0d227c238c
Fix the makefile yet again 2020-12-12 21:16:40 -08:00
rohan kumar
e521afe26f
CI: fix: missing dep + no chown/chgrp 2020-12-12 21:13:25 -08:00
rohan kumar
74cb64baa1
CSS: clean up to match stylelint, csslint 2020-12-12 21:05:25 -08:00
rohan kumar
40ea94c33b
CI: use Makefile to lint, build, and deploy
Switch from the deploy.sh shell script to a more configurable Makefile.
2020-12-12 21:04:01 -08:00
rohan kumar
b9d22a1510
Update and cache-bust icons
- The old icon was too off-center; improve it.
- Add a mask icon
- Replace deprecated apple-touch-icon-precomposed.png with
  non-precomposed icon.
- Cache-bust all icons
2020-12-12 20:59:32 -08:00
rohan kumar
18812d6995
Fix touch icon placement 2020-12-12 02:51:38 -08:00
rohan kumar
3086df92eb
csslint compliance and simplification 2020-12-12 02:42:45 -08:00
rohan kumar
6cbe6cc5b1
Add apple-touch-icon-precomposed for phones
Android, iOS, and other browsers use the pseudo-standard
"apple-touch-icon-precomposed.png"; android recommends 192x192px and iOS
downscales to 180x180px.
2020-12-12 02:41:18 -08:00
rohan kumar
74e939f40b
Implement cache-busting and SRI for CSS
Use Hugo's fingerprinting pipes [0] to give external stylesheets an
identifier to enable cache-busting [1].
Since Hugo's fingerprinting automatically generates the information
needed for SRI [2], include an integrity attribute too.

I discovered this feature through webhint [3], and added the .hintrc
file I used to the repo root.

[0]: https://gohugo.io/hugo-pipes/fingerprint/
[1]: https://css-tricks.com/strategies-for-cache-busting-css/
[2]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
[3]: https://webhint.io/
2020-12-11 17:33:38 -08:00
rohan kumar
7c8b40ac4c
CI: include publickey.txt in gemini capsule 2020-12-11 12:03:40 -08:00
rohan kumar
6040dca75a
Switch from <section> to <footer>
Sections should have headings, while this is actually a footer.
2020-12-11 12:02:33 -08:00
rohan kumar
50ca441f7d
About: more details about identities 2020-12-11 12:02:02 -08:00
rohan kumar
fccac18100
Default description: "Seirdy's Home" 2020-12-11 12:01:37 -08:00
rohan kumar
d9ca7136e1
New favicon
It's just a white ":;" in Iosevka's wide variant over a black
background. Down to just 197 bytes.
2020-12-11 12:00:31 -08:00
rohan kumar
38433d16cb
Fix bad mailto: link 2020-11-30 18:41:42 -08:00
rohan kumar
9cae62eac8
Add info on plain-text emails to the footer. 2020-11-30 18:40:31 -08:00
rohan kumar
2776395a33
Improve <title> 2020-11-30 17:19:33 -08:00
rohan kumar
925b8960a8
Add missing <h1> tags 2020-11-30 17:19:33 -08:00
rohan kumar
6ede1a393f
Size: remove some unused styles 2020-11-30 13:17:15 -08:00
rohan kumar
243238be28
Fix robots.txt 2020-11-30 13:06:44 -08:00
rohan kumar
40bd939456
Increase nav link spacing on mobile
Makes them easier to tap with my sausage fingers
2020-11-30 13:06:09 -08:00
rohan kumar
bab75dcebc
Clarify HTTP Observatory scores 2020-11-30 12:09:22 -08:00
rohan kumar
4907336d96
Add bit about alt-text, clarify page size 2020-11-30 12:04:21 -08:00
rohan kumar
349ba15f38
Add robots.txt 2020-11-29 11:37:33 -08:00
rohan kumar
1e44855647
Only load syntax highlighting CSS if necessary..
Pages without highlighted code blocks don't need to load syntax.css; for
those that do, simply declare "highlight: true" in the front matter to
load the stylesheet separately.
2020-11-28 18:01:53 -08:00
rohan kumar
6fba7dbc9a
Reduced some unnecessary styles 2020-11-27 16:14:24 -08:00
rohan kumar
46512c9046
Update with feedback on page size
Added the Web Bloat Size Calculator and a snippet on how people on
trains experience a connection speed drops.

Thanks, u/Snapstromegon from Reddit!
2020-11-27 10:25:03 -08:00
rohan kumar
55543cf9b2
My gemlog deserves sane date formats too!
In the name of ISO 8601, RFC 3339, and sorting by number: ramen.
2020-11-25 22:38:16 -08:00
rohan kumar
1c75fe501b
Renamed max770px.css -> narrow.css
I don't want to re-name this every time I change the pixel count
2020-11-25 22:31:28 -08:00
rohan kumar
131ad941d7
CSS: navbar tweaks (responsiveness + color)
- Dark mode: make navbar links the same color as regular links so as to
not hide the fact that they are links.
- Make navbar reflow at narrow window sizes
2020-11-25 22:19:52 -08:00
rohan kumar
25ffbd9bbb
Use a sane date format
ISO 8601 and RFC 3339 are the correct date formats.
The other date formats are incorrect.
2020-11-25 22:18:09 -08:00
rohan kumar
8e38c66243
Add pngquant to image compression section
Thanks, arnt and vbernat!
2020-11-25 21:58:37 -08:00
rohan kumar
970fa0e057
CI: Only gzip when deploying to seirdy.one
Only seirdy.one uses gzip_static
2020-11-25 21:58:08 -08:00
rohan kumar
3474c2d5f4
Better and smaller favicon
830 bytes ought to be enough for anyone.
- Better cropping
- Half the size
2020-11-25 16:38:35 -08:00
rohan kumar
1ba46835be
Clarification on HTTP/2
Thanks, reezer!
2020-11-25 16:36:40 -08:00