Compare commits

..

No commits in common. "main" and "v1.0.0" have entirely different histories.
main ... v1.0.0

12 changed files with 17258 additions and 4914 deletions

1
.gitignore vendored
View file

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

View file

@ -29,13 +29,9 @@ $ pnpm i
| `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 > For the deploy script, you need to add an environmental variable named HOST
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`
----- -----
*Just keep building.*<br /> > Just keep building.
*~Ayo* > ~Ayo

View file

@ -3,8 +3,6 @@ import { defineConfig } from 'astro/config'
import serviceWorker from '@ayco/astro-sw' import serviceWorker from '@ayco/astro-sw'
import sitemap from '@astrojs/sitemap' import sitemap from '@astrojs/sitemap'
import * as data from './package.json'
import icon from 'astro-icon' import icon from 'astro-icon'
// https://astro.build/config // https://astro.build/config
@ -18,7 +16,7 @@ export default defineConfig({
serviceWorker({ serviceWorker({
path: './src/sw.mjs', path: './src/sw.mjs',
assetCachePrefix: 'ayco-personal-site', assetCachePrefix: 'ayco-personal-site',
assetCacheVersionID: data.version, assetCacheVersionID: 'sigma',
logAssets: true, logAssets: true,
esbuild: { esbuild: {
minify: true, minify: true,

13094
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
{ {
"name": "@ayco/personal-website", "name": "@ayco/personal-website",
"type": "module", "type": "module",
"version": "1.3.0", "version": "1.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"astro": "astro", "astro": "astro",
@ -22,35 +22,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.3.0",
"@ayco/astro-sw": "^0.8.14", "@ayco/astro-sw": "^0.8.14",
"@eslint/compat": "^1.3.1", "@eslint/compat": "^1.2.8",
"@eslint/js": "^9.32.0", "@eslint/js": "^9.24.0",
"@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.36",
"@iconify-json/tabler": "^1.2.20", "@iconify-json/tabler": "^1.2.18",
"@typescript-eslint/parser": "^8.38.0", "@typescript-eslint/parser": "^8.29.1",
"astro": "^5.12.8", "astro": "^5.6.1",
"astro-eslint-parser": "^1.2.2", "astro-eslint-parser": "^1.2.2",
"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": "^9.24.0",
"eslint-plugin-astro": "^1.3.1", "eslint-plugin-astro": "^1.3.1",
"eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-jsx-a11y": "^6.10.2",
"globals": "^16.3.0", "globals": "^16.0.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"jiti": "^2.5.1", "jiti": "^2.4.2",
"lint-staged": "^16.1.2", "lint-staged": "^15.5.1",
"pathe": "^2.0.3", "pathe": "^2.0.3",
"prettier": "^3.6.2", "prettier": "^3.5.3",
"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.8.3",
"typescript-eslint": "^8.38.0", "typescript-eslint": "^8.29.1",
"unified": "^11.0.5" "unified": "^11.0.5"
}, },
"lint-staged": { "lint-staged": {
@ -62,5 +62,5 @@
"prettier --write" "prettier --write"
] ]
}, },
"packageManager": "pnpm@10.14.0" "packageManager": "pnpm@7.28.0+sha1.48be3292711ad554fe944f6caaf9b0f5477524fe"
} }

File diff suppressed because it is too large Load diff

View file

@ -32,8 +32,8 @@ const year = new Date().getFullYear()
aria-label={linkObj.text} aria-label={linkObj.text}
> >
<Icon <Icon
width="1em" width="1.5em"
height="1em" height="1.5em"
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" >.
>source code.</a
>
</p> </p>
<WebRings /> <WebRings />

View file

@ -40,21 +40,11 @@ export const links: Link[] = [
export default links export default links
export const footerLinks: Link[] = [ export const footerLinks: Link[] = [
{
text: "Ayo's Forge",
url: 'https://git.ayo.run/ayo/',
icon: 'git',
},
{ {
text: 'SourceHut', text: 'SourceHut',
url: 'https://sr.ht/~ayoayco', url: 'https://ayco.io/sh/',
icon: 'sourcehut', icon: 'sourcehut',
}, },
{
text: 'GitHub',
url: 'https://ayco.io/gh',
icon: 'github',
},
{ {
text: 'Mastodon', text: 'Mastodon',
url: 'https://social.ayco.io/public/local', url: 'https://social.ayco.io/public/local',
@ -66,14 +56,9 @@ export const footerLinks: Link[] = [
icon: 'pixelfed', icon: 'pixelfed',
}, },
{ {
text: 'Bluesky', text: 'GitHub',
url: 'http://bsky.app/profile/ayco.io', url: 'https://ayco.io/gh',
icon: 'bluesky', icon: 'github',
},
{
text: 'LinkedIn',
url: 'https://www.linkedin.com/in/ayoayco/',
icon: 'linkedin',
}, },
] ]

View file

@ -103,7 +103,7 @@ const { title, description, ogImage } = Astro.props
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
a { a {
color: var(--text-color-light); color: var(--color-brand-blue-3);
} }
} }
</style> </style>

View file

@ -2,7 +2,7 @@
import Layout from '../layouts/Layout.astro' 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'
--- ---
<Layout> <Layout>
@ -29,11 +29,11 @@ import Footer from '../components/Footer.astro'
<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>
</a--> </a>
</div> </div>
</div> </div>
</section> </section>
@ -43,9 +43,7 @@ import Footer from '../components/Footer.astro'
I care about the <em>Web</em>, and I love to <em>create</em> stuff to <em I care about the <em>Web</em>, and I love to <em>create</em> stuff to <em
>inspire</em >inspire</em
> and <em>serve</em> others. > and <em>serve</em> others.
<!-- <a href="/about">More?</a>
<a href="/about">More?</a>
-->
</p> </p>
</section> </section>
<section class="cards-section"> <section class="cards-section">

View file

@ -16,12 +16,6 @@ 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 simple machine learning text-to-speech program for the terminal"
/>
<Card <Card
newTab newTab
href="https://mcfly.js.org" href="https://mcfly.js.org"
@ -48,7 +42,7 @@ import Card from '../components/Card.astro'
/> />
<Card <Card
newTab newTab
href="https://ayco.io/n/generate-timezone-json" href="https://ayco.io/gh/generate-timezone-json"
title="Time Zone JSON Generator" title="Time Zone JSON Generator"
body="Generate a JSON file containing time zones from the official IANA Database or your own zone.tab file" body="Generate a JSON file containing time zones from the official IANA Database or your own zone.tab file"
/> />

View file

@ -6,39 +6,17 @@
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 caches.delete(key)
.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...', {
@ -56,14 +34,6 @@ 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)
@ -79,6 +49,9 @@ 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
@ -91,13 +64,11 @@ const networkFirst = async ({ request, fallbackUrl }) => {
return responseFromCache return responseFromCache
} }
// If fallback is provided, try to use it, otherwise return error // Try the fallback
if (fallbackUrl) { const fallbackResponse = await cache.match(fallbackUrl)
const fallbackResponse = await cache.match(fallbackUrl) if (fallbackResponse) {
if (fallbackResponse) { console.info('using fallback cached response...', fallbackResponse.url)
console.info('using fallback cached response...', fallbackResponse.url) return fallbackResponse
return fallbackResponse
}
} }
// when even the fallback response is not available, // when even the fallback response is not available,