From a1dd42f710f1f5d0e6d9af85311b3841821b2b33 Mon Sep 17 00:00:00 2001 From: mtps Date: Tue, 20 Oct 2026 13:10:46 +0000 Subject: [PATCH] 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 --- .npmrc | 1 + README.md | 10 ++++++---- astro.config.mjs | 3 +-- content/profile/profile.yml | 6 +++--- package.json | 3 ++- pnpm-lock.yaml | 8 ++++++++ pnpm-workspace.yaml | 3 +++ src/pages/index.astro | 36 +++++++++++++++++++++++++----------- 8 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 .npmrc create mode 100644 pnpm-workspace.yaml diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..cb2b1bc --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@mtps:registry=https://git.app.ygg/api/packages/mtps/npm/ diff --git a/README.md b/README.md index 7a55140..6d33686 100644 --- a/README.md +++ b/README.md @@ -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/ ``` diff --git a/astro.config.mjs b/astro.config.mjs index 96b5e07..157b5de 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -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/.html instead of p//index.html: static-server's nginx // serves $uri.html, so /p/ works without a trailing-slash redirect build: { format: 'file' }, diff --git a/content/profile/profile.yml b/content/profile/profile.yml index f5fda37..89b22be 100644 --- a/content/profile/profile.yml +++ b/content/profile/profile.yml @@ -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 diff --git a/package.json b/package.json index 7b48c57..819ee98 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 29c53fb..89c0c63 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..6655b3a --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +# our own packages, published from git.app.ygg; no point waiting for them to age +minimumReleaseAgeExclude: + - '@mtps/*' diff --git a/src/pages/index.astro b/src/pages/index.astro index 44afbde..7b16e70 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -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();
- { - profile.avatar ? ( - - ) : ( - - ) - } +
+ { + profile.avatar ? ( + + ) : ( + + ) + } +

{profile.name}

{photos.length} {photos.length === 1 ? 'photo' : 'photos'}

@@ -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;