Compare commits

...

123 commits
v1.2.0 ... main

Author SHA1 Message Date
Ayo
7d0c78c029 chore: delete unused images 2026-03-14 23:00:45 +01:00
Ayo
35bb33cf8f chore: update scripts 2026-03-14 23:00:33 +01:00
Ayo
94cca820ad 1.3.51 2026-03-14 22:46:27 +01:00
Ayo
1867a6bbfd chore: push after deploy 2026-03-14 22:46:19 +01:00
Ayo
0f0fe2232c 1.3.50 2026-03-14 22:03:20 +01:00
Ayo
69a6543de7 feat: add codepen to links 2026-03-14 22:02:59 +01:00
Ayo
106e73fbcc 1.3.49 2026-03-14 20:26:49 +01:00
Ayo
5f6deea201 feat: remove sr.ht from links 2026-03-14 20:26:33 +01:00
Ayo
ed01a40995 1.3.48 2026-03-14 20:17:59 +01:00
Ayo
e7f64fd4a5 feat: set bsky profile to https://bsky.app/profile/ayo.run 2026-03-14 20:17:40 +01:00
Ayo
3d5ec86933 1.3.47 2026-03-07 08:50:50 +01:00
Ayo
da2ffe3bdb feat: link showcase cards to git.ayo.run instead of sr.ht 2026-03-07 08:50:39 +01:00
Ayo
87451a1e58 1.3.46 2026-03-05 19:50:56 +01:00
Ayo
65efc3b5ab feat: add astro reactive to stuff 2026-03-05 19:50:45 +01:00
Ayo
637026f89a 1.3.45 2026-02-26 10:09:50 +01:00
Ayo
be8025d416 feat: use mastodon account note as p-note 2026-02-26 10:09:12 +01:00
Ayo
f986a9f5f0 1.3.44 2026-02-25 22:31:44 +01:00
Ayo
4ca4dbc449 feat: update robots.txt 2026-02-25 22:31:32 +01:00
Ayo
2f4a461b1d 1.3.43 2026-02-25 22:24:41 +01:00
Ayo
36f5dcbde0 feat: update robots.txt to disallow latest AI crawlers 2026-02-25 22:24:27 +01:00
Ayo
d2ffd9ed8a 1.3.42 2026-02-25 20:42:23 +01:00
Ayo
607a7720e5 feat: use mastodon account avatar as og:image 2026-02-25 20:41:52 +01:00
Ayo
634a1d446c 1.3.41 2026-02-25 20:19:44 +01:00
Ayo
48e3acde2f fix: add "px" into style width 2026-02-25 20:19:06 +01:00
Ayo
cf69d45064 1.3.40 2026-02-25 20:07:30 +01:00
Ayo
1d975fdc09 feat: use mastodon account avatar as remote source for astro Picture component 2026-02-25 20:06:32 +01:00
Ayo
d501aadbbb chore: no quiet 2026-02-23 22:50:12 +01:00
Ayo
7004cc7908 chore: no mirror 2026-02-23 22:49:51 +01:00
Ayo
ea081f8228 1.3.39 2026-02-22 21:42:01 +01:00
Ayo
d1ed7f697d chore: update post-commit hook 2026-02-22 21:41:53 +01:00
Ayo
2b3f671400 chore: update post-commit hook 2026-02-22 21:40:34 +01:00
Ayo
9f9a1110ad chore: update post-commit hook 2026-02-22 21:39:42 +01:00
Ayo
0c3c2ae5d9 1.3.38 2026-02-22 21:37:56 +01:00
Ayo
d83fd10ca6 feat: change links order 2026-02-22 21:37:48 +01:00
Ayo
2b553aea71 1.3.37 2026-02-22 21:09:36 +01:00
Ayo
ce9d089dd7 feat: add CV file as public asset 2026-02-22 21:09:19 +01:00
Ayo
d466300ee7 1.3.36 2026-02-22 21:06:29 +01:00
Ayo
a1fc7307c4 feat: update cv link 2026-02-22 21:06:18 +01:00
Ayo
f3a13cbfc5 1.3.35 2026-02-22 19:38:42 +01:00
Ayo
91c8a6e112 feat: update now page content 2026-02-22 19:38:32 +01:00
Ayo
f2d5fea663 1.3.34 2026-02-22 17:44:21 +01:00
Ayo
d0d3875fb9 feat: update now page content 2026-02-22 17:44:12 +01:00
Ayo
2fb93904fe 1.3.33 2026-02-22 16:52:35 +01:00
Ayo
e2b995c44f chore: update now publish state 2026-02-22 16:52:26 +01:00
Ayo
b249c4e820 1.3.32 2026-02-22 15:45:47 +01:00
Ayo
dc871cdea7 feat: udpate now page 2026-02-22 15:45:21 +01:00
Ayo
27b5b29a0b chore: update readme 2026-02-22 15:22:14 +01:00
Ayo
c7a7177d9d chore: show off 2026-02-22 15:20:30 +01:00
Ayo
1e2734dc3a chore: add auto mirror on post-commit hook 2026-02-22 15:17:47 +01:00
Ayo
6dbc9a0257 1.3.31 2026-01-25 19:56:53 +01:00
Ayo
22b192b8ca fix: remove duplicate "previously" post 2026-01-25 19:56:46 +01:00
Ayo
cc2e84f8d3 1.3.30 2026-01-25 19:54:11 +01:00
Ayo
7b26596b0b fix: homepage now link 2026-01-25 19:54:04 +01:00
Ayo
4344aa8a79 1.3.29 2026-01-25 19:52:07 +01:00
Ayo
f54aeb5fcc fix: now page 2026-01-25 19:52:00 +01:00
Ayo
e797e6905a 1.3.28 2026-01-25 19:07:07 +01:00
Ayo
3f0fa83286 chore(deps): update to latest 2026-01-25 19:06:30 +01:00
Ayo
246ec08076 1.3.27 2026-01-05 17:30:22 +01:00
Ayo
381db28b9f feat: use main.elk.zone for masto profile 2026-01-05 17:30:14 +01:00
Ayo
41a5bfc307 1.3.26 2026-01-04 15:38:35 +01:00
Ayo
88a6ae4b31 feat: change URL to org acronym 2026-01-04 15:38:27 +01:00
Ayo
4e9ebdbd95 1.3.25 2026-01-03 12:39:59 +01:00
Ayo
4efd5c9215 feat: add instagram 2026-01-03 12:39:06 +01:00
Ayo
317b5675b6 feat: put gh as last link 2026-01-03 12:35:51 +01:00
Ayo
adcd9af337 1.3.24 2026-01-03 12:33:01 +01:00
Ayo
d3eff70590 feat: use Elk to open Mastodon profile 2026-01-03 12:32:54 +01:00
Ayo
10ffd08754 1.3.23 2026-01-03 11:58:36 +01:00
Ayo
6e68472aa0 feat: update about page 2026-01-03 11:58:31 +01:00
Ayo
4ff4a5463f 1.3.22 2026-01-03 11:53:06 +01:00
Ayo
3ff47cc3a1 feat: update about page 2026-01-03 11:53:00 +01:00
Ayo
b10553cece 1.3.21 2026-01-03 11:35:40 +01:00
Ayo
544291d300 feat: remove interruption on the about page 2026-01-02 23:22:16 +01:00
Ayo
e021c2577b feat: update site description and about page content 2026-01-02 23:21:34 +01:00
Ayo
f3a20ee6aa feat: update site description 2026-01-02 23:16:53 +01:00
Ayo
ec46605828 1.3.20 2026-01-02 23:08:31 +01:00
Ayo
bc05c38cad feat: archive github-stats and bsky-fedi showcase items 2026-01-02 23:08:03 +01:00
Ayo
118df55742 1.3.19 2025-12-28 10:23:17 +01:00
Ayo
97063d1003 feat: update avatar 2025-12-28 10:23:11 +01:00
Ayo
c7edad0e56 1.3.18 2025-12-27 15:23:39 +01:00
Ayo
8f3e37aaba 1.3.17 2025-12-27 15:23:34 +01:00
Ayo
ebe1811e93 feat: update masto link 2025-12-27 15:23:28 +01:00
Ayo
c33da25571 1.3.16 2025-12-27 15:12:42 +01:00
Ayo
f681e3c4c3 chore: archive astro-github-stats 2025-12-27 15:12:26 +01:00
Ayo
f326027e58 feat: update site description 2025-12-27 15:07:59 +01:00
Ayo
5bd128b742 1.3.15 2025-12-15 14:19:40 +01:00
Ayo
086ecc0aab 1.3.14 2025-12-15 14:19:36 +01:00
Ayo
372efb9ef0 1.3.13 2025-12-15 14:19:17 +01:00
Ayo
988b138d91 1.3.12 2025-12-15 14:19:07 +01:00
Ayo
7f0c0934d6 feat: update showcase card for Simple TTS 2025-12-15 14:18:58 +01:00
Ayo
62a0c45842 chore: add example .env file 2025-11-21 11:12:29 +01:00
Ayo
1262e971c4 chore: update instructions on cache invalidation 2025-11-21 11:09:51 +01:00
Ayo
e097c27286 chore: update deployment instructions 2025-11-21 11:07:23 +01:00
Ayo
174f88776e 1.3.11 2025-11-21 11:05:12 +01:00
Ayo
5309732f80 1.3.10 2025-11-21 11:05:07 +01:00
Ayo
98f6aaddcd 1.3.9 2025-11-21 11:04:57 +01:00
Ayo
0d0a27038f feat: update bsky bridged csv 2025-11-21 11:04:53 +01:00
Ayo
1bce80b7b5 1.3.8 2025-11-21 10:41:11 +01:00
Ayo
fc0c3fcc12 1.3.7 2025-11-21 10:41:07 +01:00
Ayo
c630b75655 1.3.6 2025-11-21 10:40:46 +01:00
Ayo
6be1724d19 feat: update bsky bridged accounts csv 2025-11-21 10:40:39 +01:00
Ayo
38a822c1d5 chore: update readme 2025-11-18 09:52:47 +01:00
Ayo
c61becc74a 1.3.5 2025-11-18 09:50:31 +01:00
Ayo
14b5cf7976 chore: update version 2025-11-18 09:50:26 +01:00
Ayo
74eb4def38 1.3.4 2025-11-18 09:48:27 +01:00
Ayo
bff85a8e8f feat: update source code link 2025-11-18 09:47:52 +01:00
Ayo
fa8a760b70 1.3.3 2025-11-18 09:38:41 +01:00
Ayo
7b9c16ad46 feat: publish /tech-bsky-fedi 2025-11-18 09:38:19 +01:00
Ayo
3c0faf0254 1.3.2 2025-11-15 20:38:14 +01:00
Ayo
39673fb468 feat: link to masto about 2025-11-15 20:38:08 +01:00
Ayo
fa151985c1 1.3.1 2025-11-15 20:36:40 +01:00
Ayo
7b66d97af7 feat: empty now page 2025-11-15 20:36:27 +01:00
Ayo
92d58e9170 feat: update masto link to profile 2025-11-15 20:36:15 +01:00
Ayo
e57fad7b00 feat(links): update bsky 2025-10-30 18:08:28 +01:00
Ayo
3b5bf08541 feat: hide now link (for now) 2025-09-15 09:09:56 +02:00
Ayo
a8b77eca65 feat: update link sr.ht 2025-09-07 10:22:52 +02:00
Ayo
e79a6b29fc feat: add simple-tts in showcase 2025-09-05 14:11:15 +02:00
Ayo
29a29e4d63 chore(sw): update jsdoc 2025-08-26 01:23:30 +02:00
Ayo
343568042c refactor(sw): check for fallbackUrl 2025-08-26 00:53:34 +02:00
Ayo
f80807eebd chore(sw): add jsdoc 2025-08-26 00:47:00 +02:00
Ayo
f755588f58 chore: formatting 2025-08-26 00:25:55 +02:00
Ayo
410f43166c feat(sw): warn if failed to delete old cache 2025-08-26 00:20:08 +02:00
Ayo
0d0b9d44eb 1.3.0 2025-08-19 16:32:42 +02:00
Ayo
17e33c9659 feat(footer): show more social links; add forgejo 2025-08-19 16:28:03 +02:00
29 changed files with 2346 additions and 1725 deletions

2
.env.example Normal file
View file

@ -0,0 +1,2 @@
# replace with correct IP, and rename the file to .env
HOST=123.456.789.00

1
.gitignore vendored
View file

@ -2,6 +2,7 @@
dist/ dist/
.output/ .output/
.astro/ .astro/
.continue/
# dependencies # dependencies
node_modules/ node_modules/

3
.husky/post-commit Normal file
View file

@ -0,0 +1,3 @@
echo "post-commit..."
git push gh
git push sh

View file

@ -1 +1,2 @@
npx lint-staged echo "pre-commit..."
npx lint-staged

View file

@ -10,7 +10,7 @@ You need [node](https://nodejs.org) and [pnpm](https://pnpm.io).
```bash ```bash
# clone project # clone project
$ git clone git@git.sr.ht:~ayoayco/ayco.io-astro $ git clone https://git.ayo.run/ayo/ayco.io-astro
# go into project dir # go into project dir
$ cd ./ayco.io-astro $ cd ./ayco.io-astro
@ -26,16 +26,29 @@ $ pnpm i
| ------------------- | ---------------------------------------------- | | ------------------- | ---------------------------------------------- |
| `pnpm run dev` | start dev server | | `pnpm run dev` | start dev server |
| `pnpm run build` | generate static files to `dist` directory | | `pnpm run build` | generate static files to `dist` directory |
| `pnpm run deploy` | upload to my server | | `pnpm run deploy` | upload to my server |
| `pnpm run prep:now` | back up and clear current `now page` constants | | `pnpm run prep:now` | back up and clear current `now page` constants |
## Deployment ## Deployment
For the script `npm run deploy`, you need to add an environmental variable named HOST containing the IP address of the host server. This will scp the build files into the server. For the script `npm run deploy`, you need to add an environmental variable named HOST containing the IP address of the host server. This will scp the build files into the server.
If you want to run build before deploying, do `npm run build:deploy` You can do this by adding a `.env` file with the following content (replace the IP):
----- ```bash
# .env
HOST=123.456.789.00
```
*Just keep building.*<br /> There is a service worker (`src/sw.mjs`) that caches assets on client browsers. For cache invalidation, the version property in package.json is used. Increment the version via `npm version patch` (or `minor`, `major`) if there is a significant change in the website's assets.
*~Ayo*
If you want to run build before deploying, do `npm run build:deploy`
## Auto-mirror to various code forges
The power of git lies within its decentralized nature. I push this project to three different code forges, because I'm paranoid like that. No, I just like to show off. I do this with a post-commit hook that automatically calls `git push <repo> --mirror`, and you can see that in the `.husky/post-commit` file.
---
_Just keep building._<br />
_~Ayo_

View file

@ -1,9 +1,9 @@
--- ---
import { Code } from 'astro:components' import { Code } from 'astro:components'
import { Image } from 'astro:assets' import { Image } from 'astro:assets'
import Footer from '../components/Footer.astro' import Footer from '../../components/Footer.astro'
import Layout from '../layouts/Layout.astro' import Layout from '../../layouts/Layout.astro'
import importedCode from '../../public/following_accounts.csv?raw' import importedCode from '../../../public/following_accounts.csv?raw'
const csvToArray = (content: string) => { const csvToArray = (content: string) => {
return content return content

View file

@ -11,7 +11,8 @@ import icon from 'astro-icon'
export default defineConfig({ export default defineConfig({
site: 'https://ayo.ayco.io', site: 'https://ayo.ayco.io',
image: { image: {
domains: ['cdn.bsky.app'], domains: ['cdn.bsky.app', 'media.ayco.io'],
remotePatterns: [{ protocol: 'https' }],
}, },
integrations: [ integrations: [
sitemap(), sitemap(),

View file

@ -1,7 +1,7 @@
{ {
"name": "@ayco/personal-website", "name": "@ayco/personal-website",
"type": "module", "type": "module",
"version": "1.2.0", "version": "1.3.51",
"private": true, "private": true,
"scripts": { "scripts": {
"astro": "astro", "astro": "astro",
@ -12,7 +12,8 @@
"lint": "eslint . --config eslint.config.mjs --cache", "lint": "eslint . --config eslint.config.mjs --cache",
"format": "prettier . --write", "format": "prettier . --write",
"check": "npm run format && npm run lint", "check": "npm run format && npm run lint",
"deploy": "eval $(grep '^HOST' .env) && scp -r dist ayo@$HOST:~/ayco.io-flask", "deploy": "eval $(grep '^HOST' .env) && scp -v -r dist ayo@$HOST:~/ayco.io-flask",
"patch:build:deploy": "npm run patch && npm run build && npm run deploy",
"build:preview": "npm run build && astro preview", "build:preview": "npm run build && astro preview",
"build:deploy": "npm run build && npm run deploy", "build:deploy": "npm run build && npm run deploy",
"copy:dist": "npm run build && cp -R dist ../ayco.io-flask/", "copy:dist": "npm run build && cp -R dist ../ayco.io-flask/",
@ -22,35 +23,35 @@
"devDependencies": { "devDependencies": {
"@astro-reactive/form": "^0.10.1", "@astro-reactive/form": "^0.10.1",
"@astro-reactive/validator": "^0.5.1", "@astro-reactive/validator": "^0.5.1",
"@astrojs/sitemap": "^3.4.2", "@astrojs/sitemap": "^3.7.0",
"@ayco/astro-sw": "^0.8.14", "@ayco/astro-sw": "^0.8.14",
"@eslint/compat": "^1.3.1", "@eslint/compat": "^2.0.2",
"@eslint/js": "^9.32.0", "@eslint/js": "^10.0.1",
"@iconify-json/mdi": "^1.2.3", "@iconify-json/mdi": "^1.2.3",
"@iconify-json/simple-icons": "^1.2.45", "@iconify-json/simple-icons": "^1.2.71",
"@iconify-json/tabler": "^1.2.20", "@iconify-json/tabler": "^1.2.27",
"@typescript-eslint/parser": "^8.38.0", "@typescript-eslint/parser": "^8.56.0",
"astro": "^5.12.8", "astro": "^5.17.3",
"astro-eslint-parser": "^1.2.2", "astro-eslint-parser": "^1.3.0",
"astro-github-stats": "^0.8.0", "astro-github-stats": "^0.8.0",
"astro-icon": "^1.1.5", "astro-icon": "^1.1.5",
"consola": "^3.4.2", "consola": "^3.4.2",
"eslint": "^9.32.0", "eslint": "^10.0.1",
"eslint-plugin-astro": "^1.3.1", "eslint-plugin-astro": "^1.6.0",
"eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-jsx-a11y": "^6.10.2",
"globals": "^16.3.0", "globals": "^17.3.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"jiti": "^2.5.1", "jiti": "^2.6.1",
"lint-staged": "^16.1.2", "lint-staged": "^16.2.7",
"pathe": "^2.0.3", "pathe": "^2.0.3",
"prettier": "^3.6.2", "prettier": "^3.8.1",
"prettier-plugin-astro": "^0.14.1", "prettier-plugin-astro": "^0.14.1",
"rehype-stringify": "^10.0.1", "rehype-stringify": "^10.0.1",
"remark-parse": "^11.0.0", "remark-parse": "^11.0.0",
"remark-rehype": "^11.1.2", "remark-rehype": "^11.1.2",
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.9.2", "typescript": "^5.9.3",
"typescript-eslint": "^8.38.0", "typescript-eslint": "^8.56.0",
"unified": "^11.0.5" "unified": "^11.0.5"
}, },
"lint-staged": { "lint-staged": {

File diff suppressed because it is too large Load diff

BIN
public/Ayco_Resume.pdf Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View file

@ -8,8 +8,7 @@ jay.bsky.team@bsky.brid.gy, true, false,
b0rk.jvns.ca@bsky.brid.gy, true, false, b0rk.jvns.ca@bsky.brid.gy, true, false,
seldo.com@bsky.brid.gy, true, false, seldo.com@bsky.brid.gy, true, false,
nerdy.dev@bsky.brid.gy, true, false, nerdy.dev@bsky.brid.gy, true, false,
wongmjane.com@bsky.brid.gy, true, false, samuel.fm@bsky.brid.gy, true, false,
samuel.bsky.team@bsky.brid.gy, true, false,
laurenshof.online@bsky.brid.gy, true, false, laurenshof.online@bsky.brid.gy, true, false,
bell.bz@bsky.brid.gy, true, false, bell.bz@bsky.brid.gy, true, false,
matrix.org@bsky.brid.gy, true, false, matrix.org@bsky.brid.gy, true, false,
@ -29,10 +28,9 @@ jacobhands.com@bsky.brid.gy, true, false,
malstrom.me@bsky.brid.gy, true, false, malstrom.me@bsky.brid.gy, true, false,
shuuji3.xyz@bsky.brid.gy, true, false, shuuji3.xyz@bsky.brid.gy, true, false,
intenttoship.dev@bsky.brid.gy, true, false, intenttoship.dev@bsky.brid.gy, true, false,
haoqun.dev@bsky.brid.gy, true, false,
element.io@bsky.brid.gy, true, false, element.io@bsky.brid.gy, true, false,
e18e.dev@bsky.brid.gy, true, false, e18e.dev@bsky.brid.gy, true, false,
danabra.mov@bsky.brid.gy, true, false, danabra.mov@bsky.brid.gy, true, false,
heydonworks.bsky.social@bsky.brid.gy, true, false, heydonworks.com@bsky.brid.gy, true, false,
danielroe.dev@bsky.brid.gy, true, false, danielroe.dev@bsky.brid.gy, true, false,
patak.dev@bsky.brid.gy, true, false, patak.dev@bsky.brid.gy, true, false,

1 Account address Show boosts Notify on new posts Languages
8 b0rk.jvns.ca@bsky.brid.gy true false
9 seldo.com@bsky.brid.gy true false
10 nerdy.dev@bsky.brid.gy true false
11 wongmjane.com@bsky.brid.gy samuel.fm@bsky.brid.gy true false
samuel.bsky.team@bsky.brid.gy true false
12 laurenshof.online@bsky.brid.gy true false
13 bell.bz@bsky.brid.gy true false
14 matrix.org@bsky.brid.gy true false
28 malstrom.me@bsky.brid.gy true false
29 shuuji3.xyz@bsky.brid.gy true false
30 intenttoship.dev@bsky.brid.gy true false
haoqun.dev@bsky.brid.gy true false
31 element.io@bsky.brid.gy true false
32 e18e.dev@bsky.brid.gy true false
33 danabra.mov@bsky.brid.gy true false
34 heydonworks.bsky.social@bsky.brid.gy heydonworks.com@bsky.brid.gy true false
35 danielroe.dev@bsky.brid.gy true false
36 patak.dev@bsky.brid.gy true false

View file

@ -1,35 +1,137 @@
Sitemap: https://ayo.ayco.io/sitemap-index.xml Sitemap: https://ayo.ayco.io/sitemap-index.xml
User-agent: * User-agent: AddSearchBot
Disallow: User-agent: AI2Bot
User-agent: AI2Bot-DeepResearchEval
User-agent: AdsBot-Google User-agent: Ai2Bot-Dolma
User-agent: aiHitBot
User-agent: amazon-kendra
User-agent: Amazonbot User-agent: Amazonbot
User-agent: AmazonBuyForMe
User-agent: Amzn-SearchBot
User-agent: Amzn-User
User-agent: Andibot
User-agent: Anomura
User-agent: anthropic-ai User-agent: anthropic-ai
User-agent: Applebot User-agent: Applebot
User-agent: AwarioRssBot User-agent: Applebot-Extended
User-agent: AwarioSmartBot User-agent: atlassian-bot
User-agent: Awario
User-agent: AzureAI-SearchBot
User-agent: bedrockbot
User-agent: bigsur.ai
User-agent: Bravebot
User-agent: Brightbot 1.0
User-agent: BuddyBot
User-agent: Bytespider User-agent: Bytespider
User-agent: CCBot User-agent: CCBot
User-agent: Channel3Bot
User-agent: ChatGLM-Spider
User-agent: ChatGPT Agent
User-agent: ChatGPT-User User-agent: ChatGPT-User
User-agent: ClaudeBot User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: Claude-Web User-agent: Claude-Web
User-agent: ClaudeBot
User-agent: Cloudflare-AutoRAG
User-agent: CloudVertexBot
User-agent: cohere-ai User-agent: cohere-ai
User-agent: DataForSeoBot User-agent: cohere-training-data-crawler
User-agent: Cotoyogi
User-agent: Crawl4AI
User-agent: Crawlspace
User-agent: Datenbank Crawler
User-agent: DeepSeekBot
User-agent: Devin
User-agent: Diffbot
User-agent: DuckAssistBot
User-agent: Echobot Bot
User-agent: EchoboxBot
User-agent: FacebookBot User-agent: FacebookBot
User-agent: facebookexternalhit
User-agent: Factset_spyderbot
User-agent: FirecrawlAgent
User-agent: FriendlyCrawler User-agent: FriendlyCrawler
User-agent: Gemini-Deep-Research
User-agent: Google-CloudVertexBot
User-agent: Google-Extended User-agent: Google-Extended
User-agent: Google-Firebase
User-agent: Google-NotebookLM
User-agent: GoogleAgent-Mariner
User-agent: GoogleOther User-agent: GoogleOther
User-agent: GoogleOther-Image
User-agent: GoogleOther-Video
User-agent: GPTBot User-agent: GPTBot
User-agent: iAskBot
User-agent: iaskspider
User-agent: iaskspider/2.0
User-agent: IbouBot
User-agent: ICC-Crawler
User-agent: ImagesiftBot User-agent: ImagesiftBot
User-agent: magpie-crawler User-agent: imageSpider
User-agent: Meltwater User-agent: img2dataset
User-agent: ISSCyberRiskCrawler
User-agent: kagi-fetcher
User-agent: Kangaroo Bot
User-agent: KlaviyoAIBot
User-agent: KunatoCrawler
User-agent: laion-huggingface-processor
User-agent: LAIONDownloader
User-agent: LCC
User-agent: LinerBot
User-agent: Linguee Bot
User-agent: LinkupBot
User-agent: Manus-User
User-agent: meta-externalagent
User-agent: Meta-ExternalAgent
User-agent: meta-externalfetcher
User-agent: Meta-ExternalFetcher
User-agent: meta-webindexer
User-agent: MistralAI-User
User-agent: MistralAI-User/1.0
User-agent: MyCentralAIScraperBot
User-agent: netEstate Imprint Crawler
User-agent: NotebookLM
User-agent: NovaAct
User-agent: OAI-SearchBot
User-agent: omgili User-agent: omgili
User-agent: omgilibot User-agent: omgilibot
User-agent: peer39_crawler User-agent: OpenAI
User-agent: peer39_crawler/1.0 User-agent: Operator
User-agent: PanguBot
User-agent: Panscient
User-agent: panscient.com
User-agent: Perplexity-User
User-agent: PerplexityBot User-agent: PerplexityBot
User-agent: PiplBot User-agent: PetalBot
User-agent: Seekr User-agent: PhindBot
User-agent: Poggio-Citations
User-agent: Poseidon Research Crawler
User-agent: QualifiedBot
User-agent: QuillBot
User-agent: quillbot.com
User-agent: SBIntuitionsBot
User-agent: Scrapy
User-agent: SemrushBot-OCOB
User-agent: SemrushBot-SWA
User-agent: ShapBot
User-agent: Sidetrade indexer bot
User-agent: Spider
User-agent: TavilyBot
User-agent: TerraCotta
User-agent: Thinkbot
User-agent: TikTokSpider
User-agent: Timpibot
User-agent: TwinAgent
User-agent: VelenPublicWebCrawler
User-agent: WARDBot
User-agent: Webzio-Extended
User-agent: webzio-extended
User-agent: wpbot
User-agent: WRTNBot
User-agent: YaK
User-agent: YandexAdditional
User-agent: YandexAdditionalBot
User-agent: YouBot User-agent: YouBot
User-agent: ZanistaBot
Disallow: / Disallow: /

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 KiB

View file

@ -32,8 +32,8 @@ const year = new Date().getFullYear()
aria-label={linkObj.text} aria-label={linkObj.text}
> >
<Icon <Icon
width="1.5em" width="1em"
height="1.5em" height="1em"
name={`${linkObj.set ?? 'simple-icons'}:${linkObj.icon}`} name={`${linkObj.set ?? 'simple-icons'}:${linkObj.icon}`}
/> />
</a> </a>
@ -47,9 +47,7 @@ const year = new Date().getFullYear()
<a href="/">Ayo Ayco</a>. This website <a <a href="/">Ayo Ayco</a>. This website <a
href="https://ayos.blog/stopped-tracking-on-my-sites" href="https://ayos.blog/stopped-tracking-on-my-sites"
>does not track users</a >does not track users</a
>. See the <a href="https://git.sr.ht/~ayoayco/ayco.io-astro" >. See the <a href="https://git.ayo.run/ayo/ayco.io-astro">source code.</a>
>source code.</a
>
</p> </p>
<WebRings /> <WebRings />

View file

@ -3,17 +3,20 @@ export interface Props {
title?: string | undefined title?: string | undefined
description?: string | undefined description?: string | undefined
ogImage?: string | undefined ogImage?: string | undefined
ogFileType?: string | undefined
} }
const defaultDescription = const defaultDescription =
'Professional software engineer specializing in web development with a decade of experience building web applications for both private businesses and government-funded high-impact projects utilizing web technologies, IoT, data viz/insights, remote sensing, and GIS' 'Professional software engineer specializing in web development with a decade of experience building web applications for both private businesses and government-funded high-impact projects utilizing web technologies, IoT, data viz/insights, remote sensing, and GIS'
const defaultTitle = 'Ayo Ayco - Web Dev, Engineer, Leader, Thinker' const defaultTitle = 'Ayo Ayco - Tech Leader, Software Engineer, Web Developer'
const defaultOgImage = 'ayo.png' const defaultOgImage = 'ayo.png'
const defaultOgFileType = 'image/png'
let { let {
title, title,
description = defaultDescription, description = defaultDescription,
ogImage = defaultOgImage, ogImage = defaultOgImage,
ogFileType = defaultOgFileType,
} = Astro.props } = Astro.props
const baseURL = Astro.site?.toString().slice(0, -1) // ?? 'https://ayo.ayco.io' const baseURL = Astro.site?.toString().slice(0, -1) // ?? 'https://ayo.ayco.io'
@ -35,7 +38,8 @@ const baseURL = Astro.site?.toString().slice(0, -1) // ?? 'https://ayo.ayco.io'
<meta property="og:url" content={baseURL + Astro.url.pathname} /> <meta property="og:url" content={baseURL + Astro.url.pathname} />
<meta property="og:title" content={title} /> <meta property="og:title" content={title} />
<meta property="og:description" content={description} /> <meta property="og:description" content={description} />
<meta property="og:image" content={`/${ogImage}`} /> <meta property="og:image:type" content={ogFileType} />
<meta property="og:image" content={ogImage} />
<!-- Links --> <!-- Links -->
<link rel="canonical" href={baseURL + Astro.url.pathname} /> <link rel="canonical" href={baseURL + Astro.url.pathname} />

View file

@ -0,0 +1,7 @@
{
"title": "Reading stuff & something to look forward to",
"description": "fighting to find a direction above the storm",
"publishDate": "2025-06-10",
"publishedOn": "",
"publishState": ""
}

View file

@ -0,0 +1,12 @@
## Reading
Books I'm currently reading as I continue to have a messed up health & rhythm
- [Getting Real](https://books.37signals.com/8/getting-real)
- [How to Read a Book](https://en.wikipedia.org/wiki/How_to_Read_a_Book)
- [Code Complete 2](http://www.amazon.com/dp/0735619670/)
- [The Mythical Man-Month](http://www.amazon.com/dp/0201835959/)
## Something to look forward to
Reading has been a great companion lately. [37signals](https://37signals.com/) inspired me while reading their book "Getting Real", just in time as I'm up for updating my vision for 2030, after achieving most of my personal 2025 targets. [I want to start a cooperative that will empower people to take ownership of their digital lives.](https://social.ayco.io/@ayo/114655020696985932).

View file

@ -41,24 +41,44 @@ export default links
export const footerLinks: Link[] = [ export const footerLinks: Link[] = [
{ {
text: 'SourceHut', text: "Ayo's Forge",
url: 'https://ayco.io/sh/', url: 'https://git.ayo.run/ayo/',
icon: 'sourcehut', icon: 'git',
},
{
text: 'GitHub',
url: 'https://github.com/ayo-run',
icon: 'github',
},
{
text: 'CodePen',
url: 'https://codepen.io/ayo-run',
icon: 'codepen',
}, },
{ {
text: 'Mastodon', text: 'Mastodon',
url: 'https://yolk.ayo.run/https://social.ayco.io/public/local', url: 'https://main.elk.zone/social.ayco.io/@ayo',
icon: 'mastodon', icon: 'mastodon',
}, },
{
text: 'Bluesky',
url: 'http://bsky.app/profile/ayo.run',
icon: 'bluesky',
},
{ {
text: 'Pixelfed', text: 'Pixelfed',
url: 'https://metapixl.com/@ayo', url: 'https://metapixl.com/@ayo',
icon: 'pixelfed', icon: 'pixelfed',
}, },
{ {
text: 'GitHub', text: 'Instagram',
url: 'https://ayco.io/gh', url: 'https://www.instagram.com/ayoayco/',
icon: 'github', icon: 'instagram',
},
{
text: 'LinkedIn',
url: 'https://www.linkedin.com/in/ayoayco/',
icon: 'linkedin',
}, },
] ]

View file

@ -1,7 +1,7 @@
{ {
"title": "Reading stuff & something to look forward to", "title": "BACK AT IT",
"description": "fighting to find a direction above the storm", "description": "",
"publishDate": "2025-06-10", "publishDate": "2026-02-22",
"publishedOn": "", "publishedOn": "the 22nd day of February 2026",
"publishState": "" "publishState": ""
} }

View file

@ -1,12 +1,9 @@
## Reading Hello! Been a while!
Books I'm currently reading as I continue to have a messed up health & rhythm Yes, I'm getting back to some of my shelved side projects like <a href="https://github.com/ayoayco/mcfly#readme">McFly</a> and <a href="https://github.com/ayoayco/astro-sw#readme">Astro SW</a>.
- [Getting Real](https://books.37signals.com/8/getting-real) Why were they shelved, you ask?
- [How to Read a Book](https://en.wikipedia.org/wiki/How_to_Read_a_Book)
- [Code Complete 2](http://www.amazon.com/dp/0735619670/)
- [The Mythical Man-Month](http://www.amazon.com/dp/0201835959/)
## Something to look forward to Well, that's a story for another time.
Reading has been a great companion lately. [37signals](https://37signals.com/) inspired me while reading their book "Getting Real", just in time as I'm up for updating my vision for 2030, after achieving most of my personal 2025 targets. [I want to start a cooperative that will empower people to take ownership of their digital lives.](https://social.ayco.io/@ayo/114655020696985932). You can <a href="https://github.com/ayoayco">Follow me on GitHub</a> to see my activities on these projects if that's your thing. :)

View file

@ -8,15 +8,34 @@ import { links } from '../constants/links'
export interface Props { export interface Props {
title?: string title?: string
description?: string description?: string
ogImage?: string
} }
const { title, description, ogImage } = Astro.props const { title, description } = Astro.props
import { getImage } from 'astro:assets'
// fetch mastodon account
const response = await fetch(
'https://social.ayco.io/api/v1/accounts/lookup?acct=ayo'
)
const data = await response.json()
const { avatar } = data
const ogImage = await getImage({
src: avatar,
width: 400,
height: 400,
format: 'png',
})
const ogFileType = 'image/png'
--- ---
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<Head title={title} description={description} ogImage={ogImage} /> <Head
title={title}
description={description}
ogImage={ogImage.src}
ogFileType={ogFileType}
/>
<body class="h-card"> <body class="h-card">
<Nav links={links} /> <Nav links={links} />

View file

@ -8,51 +8,33 @@ import Footer from '../components/Footer.astro'
<h1>Ayo Ayco</h1> <h1>Ayo Ayco</h1>
<p>ᜈᜄ᜔ᜋᜓᜎ ᜐ ᜉᜒᜇ̢̟ᜎᜐ᜔ ᜅ᜔ ᜐᜒᜎᜅᜈᜈ᜔</p> <p>ᜈᜄ᜔ᜋᜓᜎ ᜐ ᜉᜒᜇ̢̟ᜎᜐ᜔ ᜅ᜔ ᜐᜒᜎᜅᜈᜈ᜔</p>
<p> <p>
Frontend guy who likes server adventures, coding, and linux. Passionate Technical engineering leader experienced in web development, software
about the indieweb, digital sovereignty, and kindness. architecture, and community building. Passionate about the indieweb,
digital sovereignty, and kindness.
</p> </p>
<details>
<summary>
Hey there! I interrupt this page for a message from this website's
sponsor...
</summary>
<p>
<strong>Myself!</strong> Thank you for wanting to read a bit more about me.
<!--Some people shy away from writing things about themselves, and thus looks negatively at others who do. But that shouldn't be the case!-->
I find it helpful to have a single canonical <code class="inline-code"
>/about</code
> page with these significant information. It is always a work in progress
(like me), and to be honest, I do this mostly as a reminder as the world
continue to impose identity onto us. Cheers to celebrating differences!
</p>
<small> Now back to the rest of the web page... </small>
</details>
<p> <p>
I am a newbie engineering manager at a large global bank headquartered in I am an engineering manager at <a href="https://ing.com">ING</a> and a certified
Amsterdam. I'm also a certified software architecture professional software architecture professional (CPSAF®) by <a
(CPSAF®) by <a href="https://isaqb.org" target="_blank">isaqb.org</a>. href="https://isaqb.org"
target="_blank">iSAQB</a
>.
</p> </p>
<p> <p>
In my spare time, when I have energy, I find it fun building <a In my spare time, I find it fun building <a href="/showcase">projects</a>,
href="/showcase">hobby projects</a running self-hosted services at <a href="https://ayo.run">ayo.run</a>, and
>, running self-hosted services at <a href="https://ayo.run">ayo.run</a>, volunteering to <a href="https://ayos.blog/why-fediverse/" target="_blank"
and volunteering to <a >Fediverse</a
href="https://ayos.blog/why-fediverse/"
target="_blank">Fediverse</a
> projects like <a href="https://elk.zone">elk.zone</a>, > projects like <a href="https://elk.zone">elk.zone</a>,
<a href="https://m.webtoo.ls/public/local">webtoo.ls</a>, and <a <a href="https://m.webtoo.ls/public/local">webtoo.ls</a>, and <a
href="https://m.webtoo.ls/@vitest">vitest's fedi presence</a href="https://m.webtoo.ls/@vitest">vitest's fedi presence</a
>. >.
</p> </p>
<p> <p>
In a previous life, I've volunteered much of my weekends into teaching I've volunteered much of my early years into leadership trainings,
kids, leading groups of students, planting a church, and facilitating teaching & leading groups of students, planting a church, and facilitating
focus group discussions with entrepreneurial founders, where I learned a focus group discussions with entrepreneurial founders, where I learned the
lot about the power of multi-generational & multi-cultural communities. power of multi-generational & multi-cultural communities.
</p> </p>
<h2 id="contact">Contact info</h2> <h2 id="contact">Contact info</h2>
<ul> <ul>
<li>✉️ Email: <a href="mailto:ayo@ayco.io">ayo@ayco.io</a></li> <li>✉️ Email: <a href="mailto:ayo@ayco.io">ayo@ayco.io</a></li>

View file

@ -3,6 +3,16 @@ import Layout from '../layouts/Layout.astro'
import Card from '../components/Card.astro' import Card from '../components/Card.astro'
import Footer from '../components/Footer.astro' import Footer from '../components/Footer.astro'
import now from '../constants/now.json' import now from '../constants/now.json'
import { Picture } from 'astro:assets'
// fetch mastodon account
const response = await fetch(
'https://social.ayco.io/api/v1/accounts/lookup?acct=ayo'
)
const data = await response.json()
const { avatar, note } = data
const avatarSize = 150
--- ---
<Layout> <Layout>
@ -12,24 +22,21 @@ import now from '../constants/now.json'
<!-- h-card details --> <!-- h-card details -->
<span class="p-name">Ayo Ayco</span> <span class="p-name">Ayo Ayco</span>
<a class="u-url u-uid" href="https://ayo.ayco.io">w</a>, <a class="u-url u-uid" href="https://ayo.ayco.io">w</a>,
<p class="p-note"> <section class="p-note" set:html={note} />
Frontend guy who likes server adventures & works w/ linux. Looking to
specialize in web perf, but mostly feels like an impostor for now. Has
hobby projects.
</p>
</div> </div>
<img <Picture
class="u-photo highlighted-section__content__profile-picture" class="u-photo highlighted-section__content__profile-picture"
alt="Ayo Ayco's avatar" alt="Ayo Ayco's avatar"
src="/ayo-sm.png" formats={['avif', 'webp']}
width="140" src={avatar}
height="140" width={avatarSize}
height={avatarSize}
/> />
<div class="highlighted-section__content__text"> <div class="highlighted-section__content__text">
<h1 title="Ayo Ayco | Software Engineer + Web Developer"> <h1 title="Ayo Ayco | Software Engineer + Web Developer">
Hi, I'm <span class="heavy-text">Ayo</span>! Hi, I'm <span class="heavy-text">Ayo</span>!
</h1> </h1>
<!-- <a href="https://forms.ayo.run/form/tnz7FybY" class="now-wrapper"> --> <!--a href="https://forms.ayo.run/form/tnz7FybY" class="now-wrapper"-->
<a href="/now" class="now-wrapper"> <a href="/now" class="now-wrapper">
<span class="now-label">now</span> <span class="now-label">now</span>
<span class="status">{now.title}</span> <span class="status">{now.title}</span>
@ -57,7 +64,7 @@ import now from '../constants/now.json'
/> />
<Card <Card
newTab={true} newTab={true}
href="https://ayco.io/cv" href="/Ayco_Resume.pdf"
title="CV / Resume" title="CV / Resume"
body="Download and peruse my skills and experience" body="Download and peruse my skills and experience"
/> />
@ -67,7 +74,7 @@ import now from '../constants/now.json'
<Footer /> <Footer />
</Layout> </Layout>
<style> <style define:vars={{ avatarSize }}>
h1 { h1 {
margin: 0; margin: 0;
color: rgba(255, 255, 255, 0.75); color: rgba(255, 255, 255, 0.75);
@ -125,8 +132,8 @@ import now from '../constants/now.json'
background-color: var(--color-brand-blue-1); background-color: var(--color-brand-blue-1);
display: block; display: block;
border-radius: 50%; border-radius: 50%;
width: 140px; width: var(--avatarSize) px;
height: 140px; height: var(--avatarSize) px;
} }
.highlighted-section__content ul a { .highlighted-section__content ul a {

View file

@ -0,0 +1,75 @@
---
import Layout from '../../../../layouts/Layout.astro'
import Footer from '../../../../components/Footer.astro'
const title = `Reading stuff & something to look forward to`
const description = `fighting to find a direction above the storm`
let publishedOn = ``
const publishDate = `2025-06-10`
const publishState = ``
const content = `<h2>Reading</h2>
<p>Books I'm currently reading as I continue to have a messed up health &#x26; rhythm</p>
<ul>
<li><a href="https://books.37signals.com/8/getting-real">Getting Real</a></li>
<li><a href="https://en.wikipedia.org/wiki/How_to_Read_a_Book">How to Read a Book</a></li>
<li><a href="http://www.amazon.com/dp/0735619670/">Code Complete 2</a></li>
<li><a href="http://www.amazon.com/dp/0201835959/">The Mythical Man-Month</a></li>
</ul>
<h2>Something to look forward to</h2>
<p>Reading has been a great companion lately. <a href="https://37signals.com/">37signals</a> inspired me while reading their book "Getting Real", just in time as I'm up for updating my vision for 2030, after achieving most of my personal 2025 targets. <a href="https://social.ayco.io/@ayo/114655020696985932">I want to start a cooperative that will empower people to take ownership of their digital lives.</a>.</p>`
publishedOn = publishedOn === '' ? publishDate : publishedOn
---
<Layout title={title} description={description}>
<main>
<h1><span class="text-gradient">{title}</span></h1>
<p>
<small>
Published on
<time datetime={publishDate}>
{publishedOn}
</time>
{publishState}
</small>
</p>
<Fragment set:html={content} />
</main>
<Footer />
</Layout>
<style>
.text-gradient {
font-weight: 900;
background-image: var(--ayo-gradient);
animation: pulse 4s ease-in-out infinite;
background-size: 500% 500%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-size: 100% 200%;
background-position-y: 100%;
border-radius: 0.4rem;
}
.highlighted-content {
margin: 1rem 0;
background: #4f39fa;
padding: 1rem;
border-radius: 0.4rem;
color: var(--color-bg);
}
.highlighted-content code {
font-size: var(--font-size-base);
border: 0.1em solid var(--color-border);
border-radius: 4px;
padding: 0.15em 0.25em;
}
.link-card-grid {
display: grid;
gap: 1rem;
padding: 0;
}
</style>

View file

@ -16,6 +16,12 @@ import Card from '../components/Card.astro'
>. >.
</p> </p>
<ul> <ul>
<Card
newTab
href="https://git.ayo.run/ayo/simple-tts#readme"
title="Simple TTS"
body="A machine learning text-to-speech program for the terminal"
/>
<Card <Card
newTab newTab
href="https://mcfly.js.org" href="https://mcfly.js.org"
@ -24,7 +30,7 @@ import Card from '../components/Card.astro'
/> />
<Card <Card
newTab newTab
href="https://ayco.io/sh/astro-sw#readme" href="https://git.ayo.run/ayo/astro-sw#readme"
title="Astro SW" title="Astro SW"
body="Integration to use your service worker with Astro" body="Integration to use your service worker with Astro"
/> />
@ -36,15 +42,15 @@ import Card from '../components/Card.astro'
/> />
<Card <Card
newTab newTab
href="https://ayco.io/sh/astro-resume#readme" href="https://git.ayo.run/ayo/astro-resume#readme"
title="Astro Resume" title="Astro Resume"
body="Utilities for serializing data from server for use in the client with types preserved across components." body="Utilities for serializing data from server for use in the client with types preserved across components."
/> />
<Card <Card
newTab newTab
href="https://ayco.io/n/generate-timezone-json" href="https://astro-reactive.js.org"
title="Time Zone JSON Generator" title="Astro Reactive"
body="Generate a JSON file containing time zones from the official IANA Database or your own zone.tab file" body="Let your Data build your UI with Astro components 🔥"
/> />
<Card <Card
newTab newTab
@ -52,6 +58,12 @@ import Card from '../components/Card.astro'
title="Cozy 🧸" title="Cozy 🧸"
body="Your modern-day reading assistant" body="Your modern-day reading assistant"
/> />
<Card
newTab
href="https://ayco.io/n/generate-timezone-json"
title="Time Zone JSON Generator"
body="Generate a JSON file containing time zones from the official IANA Database or your own zone.tab file"
/>
<Card <Card
newTab newTab
href="https://kaboom.ayco.io" href="https://kaboom.ayco.io"
@ -64,16 +76,6 @@ import Card from '../components/Card.astro'
title="Minesweeper" title="Minesweeper"
body="Recreated the classic game for the web 💣" body="Recreated the classic game for the web 💣"
/> />
<Card
href="/showcase/astro-reactive-form"
title="Reactive Form"
body="The reactive form component for Astro 🔥"
/>
<Card
href="/showcase/astro-github-stats"
title="GitHub Stats"
body="Embed GitHub stats on your Astro page ✨"
/>
</ul> </ul>
</main> </main>
<Footer /> <Footer />

View file

@ -6,17 +6,39 @@
const cacheName = `${__prefix ?? 'app'}-v${__version ?? '000'}` const cacheName = `${__prefix ?? 'app'}-v${__version ?? '000'}`
const forceLogging = true const forceLogging = true
/**
* Cleans up old service worker caches by deleting any cache that doesn't match the current cache name.
* This ensures only the current version of the application's cache is retained.
* @async
* @function cleanOldCaches
* @returns {Promise<void>} A promise that resolves when old caches have been deleted
*/
const cleanOldCaches = async () => { const cleanOldCaches = async () => {
const allowCacheNames = [cacheName] const allowCacheNames = [cacheName]
const allCaches = await caches.keys() const allCaches = await caches.keys()
allCaches.forEach((key) => { allCaches.forEach((key) => {
if (!allowCacheNames.includes(key)) { if (!allowCacheNames.includes(key)) {
console.info('Deleting old cache', key) console.info('Deleting old cache', key)
caches.delete(key) caches
.delete(key)
.then(() => {
console.info('Successfully deleted cache:', key)
})
.catch((error) => {
console.warn('Failed to delete old cache:', key, error)
})
} }
}) })
} }
/**
* Adds specified resources to the service worker cache.
* This function is used to cache static assets for offline access.
* @async
* @function addResourcesToCache
* @param {Array<string>} resources - An array of URLs representing the resources to be cached.
* @returns {Promise<void>} A promise that resolves when all resources have been successfully added to the cache.
*/
const addResourcesToCache = async (resources) => { const addResourcesToCache = async (resources) => {
const cache = await caches.open(cacheName) const cache = await caches.open(cacheName)
console.info('adding resources to cache...', { console.info('adding resources to cache...', {
@ -34,6 +56,14 @@ const addResourcesToCache = async (resources) => {
} }
} }
/**
* Puts a response in the cache.
* @async
* @function putInCache
* @param {Request} request - The request to be cached.
* @param {Response} response - The response to be cached.
* @returns {Promise<void>} A promise that resolves when the response has been added to the cache.
*/
const putInCache = async (request, response) => { const putInCache = async (request, response) => {
const cache = await caches.open(cacheName) const cache = await caches.open(cacheName)
@ -49,9 +79,6 @@ const networkFirst = async ({ request, fallbackUrl }) => {
try { try {
// Try to get the resource from the network for 5 seconds // Try to get the resource from the network for 5 seconds
const responseFromNetwork = await fetch(request.clone()) const responseFromNetwork = await fetch(request.clone())
// response may be used only once
// we need to save clone to put one copy in cache
// and serve second one
putInCache(request, responseFromNetwork.clone()) putInCache(request, responseFromNetwork.clone())
console.info('using network response', responseFromNetwork.url) console.info('using network response', responseFromNetwork.url)
return responseFromNetwork return responseFromNetwork
@ -64,11 +91,13 @@ const networkFirst = async ({ request, fallbackUrl }) => {
return responseFromCache return responseFromCache
} }
// Try the fallback // If fallback is provided, try to use it, otherwise return error
const fallbackResponse = await cache.match(fallbackUrl) if (fallbackUrl) {
if (fallbackResponse) { const fallbackResponse = await cache.match(fallbackUrl)
console.info('using fallback cached response...', fallbackResponse.url) if (fallbackResponse) {
return fallbackResponse console.info('using fallback cached response...', fallbackResponse.url)
return fallbackResponse
}
} }
// when even the fallback response is not available, // when even the fallback response is not available,