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

833 commits

Author SHA1 Message Date
Rohan Kumar
0c64c5867b
Use brotli_static with max brotli compression
Compress with brotli ahead of time in CI, just like we do with zopfli
for gzip_static

Update hintrc to check for brotli compression.

Update lighthouse config to throttle CPU some more since brotli
decompression can be heavier.
2020-12-30 23:51:14 -08:00
Rohan Kumar
2083f1aed5
Article update: include advice on avatar image
Include info on using an avatar image/profile photo without
significantly increasing the footprint of a website, by re-using the
favicon image.
2020-12-29 22:34:35 -08:00
Rohan Kumar
762ac1bf1f
Fix PGP links
- Fix bad PGP links for envs.net mirror
- Include pgp links in <head> for IndieWeb (as per
  https://indieweb.org/PGP)
2020-12-29 22:30:11 -08:00
Rohan Kumar
1e7b2008e8
Indieweb: add u-photo and h-entry where relevant
Inspired by the h-entry implementation on Charlie Owen's personal
website: https://whalecoiner.com

The u-photo re-uses the 32px favicon that the browser has already
cached, so it shouldn't bloat up the page anymore.

These changes required a bit of additional CSS. I snuck in come color
changes too.
2020-12-29 15:06:51 -08:00
Rohan Kumar
3779c08a5e
god damn it lighthouserc
I FU with the config file, leaving the reduced cpu slowdown multiplier
for my underpowered laptop.
2020-12-29 10:13:04 -08:00
Rohan Kumar
a900b814b7
Indieweb: add PGP key to h-entry 2020-12-29 10:05:07 -08:00
Rohan Kumar
1c5826e999
CI: Decrease zopfli iterations 2020-12-29 09:47:45 -08:00
Rohan Kumar
5741154155
Indieweb: more h-entry metadata
Should have all the basic elements of an h-entry now.
2020-12-28 20:11:43 -08:00
Rohan Kumar
39818533a1
Fix lighthouse again 2020-12-28 19:00:45 -08:00
Rohan Kumar
35642e698a
Add Indieweb/RDFa structured data 2020-12-28 16:56:52 -08:00
Rohan Kumar
8c63605d1a
Add 10 KB Club to web best practices article 2020-12-28 15:33:18 -08:00
Rohan Kumar
bb125c8b9f
CI: Skip unused audits instead of ignoring 2020-12-28 15:32:52 -08:00
Rohan Kumar
d429bfad2f
CI: disable unwanted lighthouse audit 2020-12-26 21:20:59 -08:00
Rohan Kumar
3471df7ab3
Remove unneeded CSS 2020-12-26 21:04:25 -08:00
Rohan Kumar
16d07c5f05
Devserver: fix CSP to allow images from seirdy.one 2020-12-26 20:44:05 -08:00
Rohan Kumar
1a89830880
Compress more when deploying to prod
Use 50 zopfli zopfli iterations when compressing for staging, but a full
1200 when compressing for prod.
2020-12-26 20:43:48 -08:00
Rohan Kumar
9fdca311c0
CI: Increase CPU slowdown multiplier
builds.sr.ht is a lot faster than my laptop.
2020-12-25 14:25:25 -08:00
Rohan Kumar
c7bf31df75
Update README with lighthouse info 2020-12-23 21:53:31 -08:00
Rohan Kumar
ed13aeb13f
Save Hugo version in bottom of <head>
I previously removed this from <head> because the first piece of
metadata should be setting the charset to utf-8. This commit adds it
back, but to the bottom of <head>.
2020-12-23 21:48:27 -08:00
Rohan Kumar
d8f6d1a913
CI: save lighthouse artifacts 2020-12-23 21:47:58 -08:00
Rohan Kumar
e989ff01c4
CI: don't install packages globally
Install bins into ~/bin instead and use local npm packages
2020-12-23 18:22:03 -08:00
Rohan Kumar
b48bd871a7
Increase padding/tap-targets
- Adding more detail to the bulleted list in /about.html makes it easier
  to tap links since they're further apart
- Pad code frames a bit
2020-12-23 17:04:40 -08:00
Rohan Kumar
51a6d4edde
CI: test with lighthouse, webhint in staging 2020-12-23 17:04:28 -08:00
Rohan Kumar
34ba9e30cf
Makefile.online: add redbot 2020-12-22 18:11:19 -08:00
Rohan Kumar
64496029ff
Add new/updated files for testing
Add new/updated config files for lighthouse, webhint, and lychee.
Ignore artifacts produced by lighthouse in .gitignroe
2020-12-21 16:47:40 -08:00
Rohan Kumar
3f2233d35e
Update README with basic build info 2020-12-21 16:45:50 -08:00
Rohan Kumar
8fdee5d244
Include layout in web best practices
Article update: decribe good layout in the website best practices
article.
2020-12-21 16:41:46 -08:00
Rohan Kumar
72e3765593
Webmanifest: re-use mask_icon as monochrome icon 2020-12-21 16:40:27 -08:00
Rohan Kumar
758460f258
Add date last updated (gitinfo)
Add the date last updated to articles, if articles have been updated
since initial publication. Incldue a link to the article changelog.
2020-12-21 16:39:23 -08:00
Rohan Kumar
6331840d95
Fix bad link
Sourcehut updated its per-object log URLs
2020-12-20 12:57:59 -08:00
Rohan Kumar
ed4aee63b9
Chore: CSS re-org
Because csslint wants CSS to be in ascending specificity.
2020-12-19 18:01:50 -08:00
Rohan Kumar
b9e4be50f5
Metadata: description + cache-bust manifest icons
- Add a cache-busting fingerprint to all the icons in the webmanifest
- Add a <meta> and open graph tag for a description.
- Include a 512px icon in the manifest
2020-12-19 17:50:55 -08:00
Rohan Kumar
ac0ced6aac
Article fix: put <body> in backticks
<body> was getting interpreted as an HTML tag instead of text.
2020-12-18 18:42:03 -08:00
Rohan Kumar
68a0528db2
Declare supported color schemes in <head>
State that both dark and light color schemes are supported in the
document <head> to inform browsers before CSS is loaded and parsed.

Also added a bunch of comments.
2020-12-18 18:33:46 -08:00
Rohan Kumar
5e77a0d7f3
Use a smaller image in an article 2020-12-18 18:33:13 -08:00
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