Make folio site-agnostic and add the @mtps/waves avatar ring
- Drop `site: 'https://ig.mtps.pl'`. Nothing reads it (no canonical, og:url or sitemap), and the app shouldn't know which site it builds. - Example content and README samples use a placeholder profile instead of mtps / mtps.pl. - Ring the avatar with @mtps/waves, Instagram-style; without an avatar the initial sits on the waves. `.npmrc` points @mtps at the Gitea registry, and pnpm-workspace.yaml exempts the scope from minimumReleaseAge. - package.json version 0.3.0, matching the next tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4b96b506d4
commit
a1dd42f710
8 files changed
+49
-21
No files matched your search
@@ -34,21 +34,23 @@ location: # never taken from EXIF
|
||||
`profile/profile.yml`:
|
||||
|
||||
```yaml
|
||||
name: mtps
|
||||
name: Jane Doe
|
||||
bio: Photos I'm happy with.
|
||||
link:
|
||||
url: https://www.mtps.pl
|
||||
label: mtps.pl
|
||||
url: https://example.com
|
||||
label: example.com
|
||||
```
|
||||
|
||||
Published images are resized copies without EXIF. The build deletes the originals from `dist/`, and `pnpm check:metadata` fails if any published image still has GPS data or a capture time. Run it before publishing a build.
|
||||
|
||||
## Development
|
||||
|
||||
The avatar ring is [@mtps/waves](https://git.app.ygg/mtps/waves), installed from the Gitea npm registry; `.npmrc` points `@mtps` there.
|
||||
|
||||
```sh
|
||||
pnpm install
|
||||
pnpm dev # example content, http://localhost:4321
|
||||
FOLIO_CONTENT=../ig.mtps.pl pnpm dev # a site's content
|
||||
FOLIO_CONTENT=../my-site pnpm dev # a site's content
|
||||
pnpm check # types
|
||||
pnpm build && pnpm check:metadata # dist/
|
||||
```
|
||||
|
||||
+1
-2
@@ -33,11 +33,10 @@ const dropUnusedOriginals = () => ({
|
||||
});
|
||||
|
||||
// photos/ and profile/ to build from; the example content by default, a site
|
||||
// repo's checkout when building a real site (FOLIO_CONTENT=../ig.mtps.pl)
|
||||
// repo's checkout when building a real site (FOLIO_CONTENT=../my-site)
|
||||
const content = resolve(process.env.FOLIO_CONTENT ?? 'content');
|
||||
|
||||
export default defineConfig({
|
||||
site: 'https://ig.mtps.pl',
|
||||
// p/<slug>.html instead of p/<slug>/index.html: static-server's nginx
|
||||
// serves $uri.html, so /p/<slug> works without a trailing-slash redirect
|
||||
build: { format: 'file' },
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Shown at the top of the page. Drop avatar.jpg (or .png/.webp) next to
|
||||
# this file for a profile picture; without one the initial is shown.
|
||||
name: mtps
|
||||
name: Jane Doe
|
||||
bio: Photos I'm happy with.
|
||||
link:
|
||||
url: https://www.mtps.pl
|
||||
label: mtps.pl
|
||||
url: https://example.com
|
||||
label: example.com
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "folio",
|
||||
"version": "0.1.0",
|
||||
"version": "0.3.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"packageManager": "pnpm@11.28.5",
|
||||
@@ -12,6 +12,7 @@
|
||||
"check:metadata": "node scripts/check-metadata.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mtps/waves": "0.1.0",
|
||||
"astro": "7.3.8",
|
||||
"exifr": "7.1.3",
|
||||
"sharp": "0.35.5",
|
||||
|
||||
Generated
+8
@@ -8,6 +8,9 @@ importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
'@mtps/waves':
|
||||
specifier: 0.1.0
|
||||
version: 0.1.0
|
||||
astro:
|
||||
specifier: 7.3.8
|
||||
version: 7.3.8(@types/node@24.19.2)(yaml@2.9.1)
|
||||
@@ -425,6 +428,9 @@ packages:
|
||||
'@jridgewell/sourcemap-codec@1.6.0':
|
||||
resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==}
|
||||
|
||||
'@mtps/waves@0.1.0':
|
||||
resolution: {integrity: sha512-RldMNcssY4TZ/KJYqg1lhdVn6bfvtHXR/On5qeED/lSDUaxUFf65L8P4CjduIQHi7sDGSJLYW3SboCR0HgFbTA==, tarball: https://git.app.ygg/api/packages/mtps/npm/@mtps%2Fwaves/-/0.1.0/waves-0.1.0.tgz}
|
||||
|
||||
'@napi-rs/wasm-runtime@1.2.4':
|
||||
resolution: {integrity: sha512-AJxoUD2/15ESHbvpcyjU274nsAPLuOtPHCk0vKJM5pj//Fg/B1FXNWjPnXTT9PymCYYiHo4zPj0ZomXBKhoy7g==}
|
||||
engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0}
|
||||
@@ -1941,6 +1947,8 @@ snapshots:
|
||||
|
||||
'@jridgewell/sourcemap-codec@1.6.0': {}
|
||||
|
||||
'@mtps/waves@0.1.0': {}
|
||||
|
||||
'@napi-rs/wasm-runtime@1.2.4(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)':
|
||||
dependencies:
|
||||
'@emnapi/core': 1.11.3
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# our own packages, published from git.app.ygg; no point waiting for them to age
|
||||
minimumReleaseAgeExclude:
|
||||
- '@mtps/*'
|
||||
+25
-11
@@ -1,5 +1,6 @@
|
||||
---
|
||||
import { Image, Picture } from 'astro:assets';
|
||||
import '@mtps/waves/waves.css';
|
||||
import Base from '../layouts/Base.astro';
|
||||
import { getPhotos } from '../lib/photos';
|
||||
import { profile } from '../lib/profile';
|
||||
@@ -9,15 +10,17 @@ const photos = await getPhotos();
|
||||
|
||||
<Base>
|
||||
<header>
|
||||
{
|
||||
profile.avatar ? (
|
||||
<Image class="avatar" src={profile.avatar} alt="" width={300} height={300} loading="eager" />
|
||||
) : (
|
||||
<div class="avatar" aria-hidden="true">
|
||||
{profile.name.charAt(0).toUpperCase()}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<div class="ring waves">
|
||||
{
|
||||
profile.avatar ? (
|
||||
<Image class="avatar" src={profile.avatar} alt="" width={300} height={300} loading="eager" />
|
||||
) : (
|
||||
<div class="avatar initial" aria-hidden="true">
|
||||
{profile.name.charAt(0).toUpperCase()}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<div class="about">
|
||||
<h1>{profile.name}</h1>
|
||||
<p class="count">{photos.length} {photos.length === 1 ? 'photo' : 'photos'}</p>
|
||||
@@ -70,17 +73,28 @@ const photos = await getPhotos();
|
||||
margin: 0 auto;
|
||||
padding: 32px 20px 40px;
|
||||
}
|
||||
.avatar {
|
||||
/* @mtps/waves as the ring around the avatar, with a gap in the page colour */
|
||||
.ring {
|
||||
flex: none;
|
||||
padding: 3px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.avatar {
|
||||
width: clamp(77px, 20vw, 150px);
|
||||
aspect-ratio: 1;
|
||||
border: 3px solid var(--bg);
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
background: var(--tile);
|
||||
}
|
||||
/* no avatar: the waves show through behind the initial */
|
||||
.initial {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border-color: transparent;
|
||||
background: none;
|
||||
font-size: clamp(32px, 8vw, 64px);
|
||||
color: var(--muted);
|
||||
color: #fff;
|
||||
}
|
||||
h1 {
|
||||
margin: 0;
|
||||
|
||||
Reference in new issue
Block a user