Compare commits
No commits in common. "main" and "v1.1.1" have entirely different histories.
11 changed files with 17126 additions and 4834 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,7 +2,6 @@
|
||||||
dist/
|
dist/
|
||||||
.output/
|
.output/
|
||||||
.astro/
|
.astro/
|
||||||
.continue/
|
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
10
README.md
10
README.md
|
@ -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
|
||||||
|
|
13094
package-lock.json
generated
Normal file
13094
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
24
package.json
24
package.json
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@ayco/personal-website",
|
"name": "@ayco/personal-website",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.3.0",
|
"version": "1.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"astro": "astro",
|
"astro": "astro",
|
||||||
|
@ -22,25 +22,25 @@
|
||||||
"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.4.1",
|
||||||
"@ayco/astro-sw": "^0.8.14",
|
"@ayco/astro-sw": "^0.8.14",
|
||||||
"@eslint/compat": "^1.3.1",
|
"@eslint/compat": "^1.3.1",
|
||||||
"@eslint/js": "^9.32.0",
|
"@eslint/js": "^9.30.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.42",
|
||||||
"@iconify-json/tabler": "^1.2.20",
|
"@iconify-json/tabler": "^1.2.19",
|
||||||
"@typescript-eslint/parser": "^8.38.0",
|
"@typescript-eslint/parser": "^8.36.0",
|
||||||
"astro": "^5.12.8",
|
"astro": "^5.11.0",
|
||||||
"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.30.1",
|
||||||
"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.3.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"jiti": "^2.5.1",
|
"jiti": "^2.4.2",
|
||||||
"lint-staged": "^16.1.2",
|
"lint-staged": "^16.1.2",
|
||||||
"pathe": "^2.0.3",
|
"pathe": "^2.0.3",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.6.2",
|
||||||
|
@ -49,8 +49,8 @@
|
||||||
"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.36.0",
|
||||||
"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"
|
||||||
}
|
}
|
||||||
|
|
8741
pnpm-lock.yaml
8741
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -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>
|
||||||
|
|
|
@ -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',
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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"
|
||||||
|
|
47
src/sw.mjs
47
src/sw.mjs
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue