Compare commits

..

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

7 changed files with 21 additions and 72 deletions

1
.gitignore vendored
View file

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

View file

@ -1,7 +1,7 @@
{
"name": "@ayco/personal-website",
"type": "module",
"version": "1.3.0",
"version": "1.2.0",
"private": true,
"scripts": {
"astro": "astro",

View file

@ -32,8 +32,8 @@ const year = new Date().getFullYear()
aria-label={linkObj.text}
>
<Icon
width="1em"
height="1em"
width="1.5em"
height="1.5em"
name={`${linkObj.set ?? 'simple-icons'}:${linkObj.icon}`}
/>
</a>

View file

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

View file

@ -2,7 +2,7 @@
import Layout from '../layouts/Layout.astro'
import Card from '../components/Card.astro'
import Footer from '../components/Footer.astro'
// import now from '../constants/now.json'
import now from '../constants/now.json'
---
<Layout>
@ -29,11 +29,11 @@ import Footer from '../components/Footer.astro'
<h1 title="Ayo Ayco | Software Engineer + Web Developer">
Hi, I'm <span class="heavy-text">Ayo</span>!
</h1>
<!--a href="https://forms.ayo.run/form/tnz7FybY" class="now-wrapper"-->
<!--a href="/now" class="now-wrapper">
<!-- <a href="https://forms.ayo.run/form/tnz7FybY" class="now-wrapper"> -->
<a href="/now" class="now-wrapper">
<span class="now-label">now</span>
<span class="status">{now.title}</span>
</a-->
</a>
</div>
</div>
</section>

View file

@ -16,12 +16,6 @@ import Card from '../components/Card.astro'
>.
</p>
<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
newTab
href="https://mcfly.js.org"

View file

@ -6,39 +6,17 @@
const cacheName = `${__prefix ?? 'app'}-v${__version ?? '000'}`
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 allowCacheNames = [cacheName]
const allCaches = await caches.keys()
allCaches.forEach((key) => {
if (!allowCacheNames.includes(key)) {
console.info('Deleting old cache', key)
caches
.delete(key)
.then(() => {
console.info('Successfully deleted cache:', key)
})
.catch((error) => {
console.warn('Failed to delete old cache:', key, error)
})
caches.delete(key)
}
})
}
/**
* 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 cache = await caches.open(cacheName)
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 cache = await caches.open(cacheName)
@ -79,6 +49,9 @@ const networkFirst = async ({ request, fallbackUrl }) => {
try {
// Try to get the resource from the network for 5 seconds
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())
console.info('using network response', responseFromNetwork.url)
return responseFromNetwork
@ -91,14 +64,12 @@ const networkFirst = async ({ request, fallbackUrl }) => {
return responseFromCache
}
// If fallback is provided, try to use it, otherwise return error
if (fallbackUrl) {
// Try the fallback
const fallbackResponse = await cache.match(fallbackUrl)
if (fallbackResponse) {
console.info('using fallback cached response...', fallbackResponse.url)
return fallbackResponse
}
}
// when even the fallback response is not available,
// there is nothing we can do, but we must always