Compare commits
No commits in common. "main" and "v1.3.78" have entirely different histories.
12 changed files with 48 additions and 109 deletions
31
README.md
31
README.md
|
|
@ -22,30 +22,13 @@ $ pnpm i
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
| Command | Action |
|
| Command | Action |
|
||||||
| ----------------------------- | ---------------------------------------------- |
|
| ------------------- | ---------------------------------------------- |
|
||||||
| `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 |
|
||||||
| `pnpm run patch:build:deploy` | increment version, build, then upload |
|
| `pnpm run patch:build:deploy` | increment version, build, then upload |
|
||||||
|
|
||||||
## Testing
|
|
||||||
|
|
||||||
This project uses Vitest for unit tests. The test script is defined in `package.json` as `vitest run .`.
|
|
||||||
|
|
||||||
Run tests locally with pnpm (recommended):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# install dependencies (if you haven't already)
|
|
||||||
pnpm i
|
|
||||||
|
|
||||||
# run tests once
|
|
||||||
pnpm test
|
|
||||||
|
|
||||||
# run Vitest in interactive/watch mode
|
|
||||||
pnpm exec vitest
|
|
||||||
```
|
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
|
|
|
||||||
16
package.json
16
package.json
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@ayco/personal-website",
|
"name": "@ayco/personal-website",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.3.88",
|
"version": "1.3.78",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"astro": "astro",
|
"astro": "astro",
|
||||||
|
|
@ -11,9 +11,8 @@
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"lint": "eslint . --config eslint.config.mjs --cache",
|
"lint": "eslint . --config eslint.config.mjs --cache",
|
||||||
"lint:fix": "eslint . --config eslint.config.mjs --fix",
|
"lint:fix": "eslint . --config eslint.config.mjs --fix",
|
||||||
"fmt": "prettier . --config prettier.config.mjs --check",
|
"format": "prettier . --write",
|
||||||
"fmt:fix": "prettier . --config prettier.config.mjs --write",
|
"check": "npm run format && npm run lint",
|
||||||
"check": "npm run fmt && npm run lint",
|
|
||||||
"deploy": "eval $(grep '^HOST' .env) && scp -r dist ayo@$HOST:~/ayco.io-flask",
|
"deploy": "eval $(grep '^HOST' .env) && scp -r dist ayo@$HOST:~/ayco.io-flask",
|
||||||
"patch:build:deploy": "npm version patch && npm run build && npm run deploy",
|
"patch:build:deploy": "npm version patch && npm run build && npm run deploy",
|
||||||
"pbd": "npm run patch:build:deploy",
|
"pbd": "npm run patch:build:deploy",
|
||||||
|
|
@ -52,7 +51,6 @@
|
||||||
"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",
|
||||||
"sharp": "^0.34.5",
|
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^6.0.3",
|
"typescript": "^6.0.3",
|
||||||
"typescript-eslint": "^8.59.3",
|
"typescript-eslint": "^8.59.3",
|
||||||
|
|
@ -63,14 +61,14 @@
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{js,mjs,astro,ts}": [
|
"*.{js,mjs,astro,ts}": [
|
||||||
"prettier . --config prettier.config.mjs --write",
|
"prettier --write",
|
||||||
"eslint . --config eslint.config.mjs --fix"
|
"eslint --fix"
|
||||||
],
|
],
|
||||||
"*.json": [
|
"*.json": [
|
||||||
"prettier . --config prettier.config.mjs --write"
|
"prettier --write"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@11.5.2+sha512.71c631e382066efc25625d5cf029075de07b61b37f6e27350fbd84b1bda5864c8c1967adc280776b45c30a715c0359a3be08fef42d5bb09e2b99029979692916",
|
"packageManager": "pnpm@11.2.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ayo-run/status-indicator": "^2.1.2",
|
"@ayo-run/status-indicator": "^2.1.2",
|
||||||
"web-component-base": "^4.1.2"
|
"web-component-base": "^4.1.2"
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,6 @@ importers:
|
||||||
remark-rehype:
|
remark-rehype:
|
||||||
specifier: ^11.1.2
|
specifier: ^11.1.2
|
||||||
version: 11.1.2
|
version: 11.1.2
|
||||||
sharp:
|
|
||||||
specifier: ^0.34.5
|
|
||||||
version: 0.34.5
|
|
||||||
tslib:
|
tslib:
|
||||||
specifier: ^2.8.1
|
specifier: ^2.8.1
|
||||||
version: 2.8.1
|
version: 2.8.1
|
||||||
|
|
@ -3258,7 +3255,8 @@ snapshots:
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@img/colour@1.1.0': {}
|
'@img/colour@1.1.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
'@img/sharp-darwin-arm64@0.34.5':
|
'@img/sharp-darwin-arm64@0.34.5':
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
|
|
@ -4124,7 +4122,8 @@ snapshots:
|
||||||
|
|
||||||
destr@2.0.5: {}
|
destr@2.0.5: {}
|
||||||
|
|
||||||
detect-libc@2.1.2: {}
|
detect-libc@2.1.2:
|
||||||
|
optional: true
|
||||||
|
|
||||||
devalue@5.8.1: {}
|
devalue@5.8.1: {}
|
||||||
|
|
||||||
|
|
@ -5776,6 +5775,7 @@ snapshots:
|
||||||
'@img/sharp-win32-arm64': 0.34.5
|
'@img/sharp-win32-arm64': 0.34.5
|
||||||
'@img/sharp-win32-ia32': 0.34.5
|
'@img/sharp-win32-ia32': 0.34.5
|
||||||
'@img/sharp-win32-x64': 0.34.5
|
'@img/sharp-win32-x64': 0.34.5
|
||||||
|
optional: true
|
||||||
|
|
||||||
shebang-command@2.0.0:
|
shebang-command@2.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ const year = new Date().getFullYear()
|
||||||
<p>
|
<p>
|
||||||
Copyright © 2022-{year}
|
Copyright © 2022-{year}
|
||||||
<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://v1.ayos.blog/stopped-tracking-on-my-sites"
|
||||||
>does not track users</a
|
>does not track users</a
|
||||||
>. See the <a href="https://git.ayo.run/ayo/ayco.io-astro">source code.</a>
|
>. See the <a href="https://git.ayo.run/ayo/ayco.io-astro">source code.</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ export const footerLinks: Link[] = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Mastodon',
|
text: 'Mastodon',
|
||||||
url: 'https://elk.zone/m.webtoo.ls/@ayo',
|
url: 'https://main.elk.zone/social.ayco.io/@ayo',
|
||||||
icon: 'mastodon',
|
icon: 'mastodon',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import { getImage } from 'astro:assets'
|
||||||
|
|
||||||
// fetch mastodon account
|
// fetch mastodon account
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
'https://m.webtoo.ls/api/v1/accounts/lookup?acct=ayo'
|
'https://social.ayco.io/api/v1/accounts/lookup?acct=ayo'
|
||||||
)
|
)
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
const { avatar } = data
|
const { avatar } = data
|
||||||
|
|
@ -51,28 +51,13 @@ const ogFileType = 'image/png'
|
||||||
font-size: var(--font-size-base);
|
font-size: var(--font-size-base);
|
||||||
color: var(--text-color-dark);
|
color: var(--text-color-dark);
|
||||||
background-color: var(--text-color-light);
|
background-color: var(--text-color-light);
|
||||||
|
|
||||||
background-image: radial-gradient(
|
|
||||||
circle,
|
|
||||||
hsl(var(--dot-grid-light)) 1px,
|
|
||||||
transparent 1px
|
|
||||||
);
|
|
||||||
background-size: 24px 24px;
|
|
||||||
background-position: -24px -24px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
html,
|
html,
|
||||||
body,
|
body,
|
||||||
* {
|
* {
|
||||||
background-color: var(--bg-darker);
|
background: var(--bg-darker);
|
||||||
color: var(--text-color-light);
|
color: var(--text-color-light);
|
||||||
|
|
||||||
background-image: radial-gradient(
|
|
||||||
circle,
|
|
||||||
hsl(var(--dot-grid-dark)) 1px,
|
|
||||||
transparent 1px
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,4 @@
|
||||||
--bg-dark: #343a40;
|
--bg-dark: #343a40;
|
||||||
--bg-darker: #212529;
|
--bg-darker: #212529;
|
||||||
--bg-darkest: #000;
|
--bg-darkest: #000;
|
||||||
|
|
||||||
--dot-grid-light: 214 32% 82%;
|
|
||||||
--dot-grid-dark: 215 25% 25%;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,9 @@ import Footer from '../components/Footer.astro'
|
||||||
<p>
|
<p>
|
||||||
In my spare time, I find it fun building <a href="/showcase">projects</a>,
|
In my spare time, I find it fun building <a href="/showcase">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>, and
|
||||||
volunteering to <a href="https://ayos.blog/why-fediverse/" target="_blank"
|
volunteering to <a
|
||||||
>Fediverse</a
|
href="https://v1.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
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { Picture } from 'astro:assets'
|
||||||
|
|
||||||
// fetch mastodon account
|
// fetch mastodon account
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
'https://m.webtoo.ls/api/v1/accounts/lookup?acct=ayo'
|
'https://social.ayco.io/api/v1/accounts/lookup?acct=ayo'
|
||||||
)
|
)
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
const { avatar, note } = data
|
const { avatar, note } = data
|
||||||
|
|
@ -38,15 +38,13 @@ const avatarSize = 150
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<a href="/now" class="now-wrapper action primary">
|
<a href="/now" class="now-wrapper action primary">
|
||||||
<span class="now-label">
|
<span class="now-label">now</span>
|
||||||
<status-indicator status="active" pulse> now </status-indicator>
|
|
||||||
</span>
|
|
||||||
<span class="status">{now.title}</span>
|
<span class="status">{now.title}</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<main class=".dot-grid">
|
<main>
|
||||||
<section class="introduction-section">
|
<section class="introduction-section">
|
||||||
<p>
|
<p>
|
||||||
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
|
||||||
|
|
@ -95,7 +93,6 @@ const avatarSize = 150
|
||||||
|
|
||||||
&.primary {
|
&.primary {
|
||||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
border-style: dotted;
|
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,8 @@ AP0YLC768PFTBm9CM5T1BE0xjJ7s4dZSrVoI4n8RSe1nCA==
|
||||||
</div>
|
</div>
|
||||||
<p>Expiry Date: 2027-05-30</p>
|
<p>Expiry Date: 2027-05-30</p>
|
||||||
<p>
|
<p>
|
||||||
Fingerprint: <code>17F1 3D5E 8FF7 372B 1354 5C38 65E6 BF64 1529 3C65</code
|
Fingerprint: <code
|
||||||
>
|
>17F1 3D5E 8FF7 372B 1354 5C38 65E6 BF64 1529 3C65</code>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p></p>
|
<p></p>
|
||||||
|
|
@ -49,29 +49,21 @@ AP0YLC768PFTBm9CM5T1BE0xjJ7s4dZSrVoI4n8RSe1nCA==
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/* Clipboard copy logic */
|
/* Clipboard copy logic */
|
||||||
const copyBtn = document.querySelector('.copy-btn')
|
document.querySelector('.copy-btn').addEventListener('click', async () => {
|
||||||
if (copyBtn) {
|
const keyText = document.querySelector('#public-key code').innerText.trim()
|
||||||
copyBtn.addEventListener('click', async () => {
|
try {
|
||||||
const keyText = (
|
await navigator.clipboard.writeText(keyText)
|
||||||
document.querySelector('#public-key code') as HTMLElement
|
const btn = document.querySelector('.copy-btn')
|
||||||
)?.innerText.trim()
|
const original = btn.textContent
|
||||||
if (!keyText) return
|
btn.textContent = 'Copied!'
|
||||||
try {
|
setTimeout(() => {
|
||||||
await navigator.clipboard.writeText(keyText)
|
btn.textContent = original
|
||||||
const btn = document.querySelector('.copy-btn')
|
}, 2000)
|
||||||
if (btn) {
|
} catch (err) {
|
||||||
const original = btn.textContent
|
console.error('Copy failed', err)
|
||||||
btn.textContent = 'Copied!'
|
alert('Unable to copy the key. Please copy it manually.')
|
||||||
setTimeout(() => {
|
}
|
||||||
btn.textContent = original
|
})
|
||||||
}, 2000)
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Copy failed', err)
|
|
||||||
alert('Unable to copy the key. Please copy it manually.')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ import Card from '../components/Card.astro'
|
||||||
<main>
|
<main>
|
||||||
<h1><span class="text-gradient">Hobby Projects</span></h1>
|
<h1><span class="text-gradient">Hobby Projects</span></h1>
|
||||||
<p>
|
<p>
|
||||||
See more of my previous projects at <a href="https://ayos.blog/projects"
|
See more of my previous projects at <a
|
||||||
>my blog</a
|
href="https://v1.ayos.blog/projects">my blog</a
|
||||||
>.
|
>.
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
import { defineConfig } from 'vitest/config'
|
|
||||||
|
|
||||||
// Exclude generated files and heavy folders from the watcher to avoid
|
|
||||||
// continuous re-runs when build output or other tools touch files.
|
|
||||||
export default defineConfig({
|
|
||||||
test: {
|
|
||||||
globals: true,
|
|
||||||
environment: 'node',
|
|
||||||
exclude: ['dist/**', 'public/**', 'node_modules/**'],
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
exclude: ['dist/**', 'public/**', 'node_modules/**', '.git/**'],
|
|
||||||
},
|
|
||||||
})
|
|
||||||
Loading…
Reference in a new issue