2 Commits
Author SHA1 Message Date
davide bd26cc8ea6 Renumber article slugs to sequential article-N
One-time PocketBase migration that replaces every article's slug with
article-1, article-2, ... ordered by publishedAt (oldest first),
requested explicitly by the site owner in place of the existing
descriptive slugs.
2026-09-14 14:44:07 +02:00
davide 728e931421 Fix mobile header overlap and thumbnail crop ratio
The language switch overlapped the centered logo on narrow viewports
(~390px), and article card covers used an overly aggressive 4:5 crop
that sliced through text baked into cover images.
2026-09-14 14:28:34 +02:00
4 changed files with 69 additions and 4 deletions
+18
View File
@@ -5,6 +5,24 @@ All notable changes to this project are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.1.1] - 2026-09-14
### Changed
- Renumbered every article's slug to sequential `article-N`, ordered by `publishedAt` (oldest
first), via a one-time PocketBase migration — replaces the previous descriptive slugs at the
owner's explicit request. Not reversible; existing links/indexed URLs using the old slugs now
404.
### Fixed
- Language switch no longer overlaps the header logo on narrow viewports (~390px, e.g. iPhone 14
Pro): it now stacks centered above the wordmark on phones, and only moves to the header's
top-right corner from tablet width up.
- Article card thumbnails no longer use an overly aggressive portrait crop (`4:5`) that sliced
through text baked into cover images — changed to `3:2`, matching the featured cover on the home
page and the article detail page.
## [2.1.0] - 2026-09-11 ## [2.1.0] - 2026-09-11
### Added ### Added
+1 -1
View File
@@ -53,7 +53,7 @@ const href = computed(() => localePath(props.locale, `/blog/${props.article.slug
.cover { .cover {
width: 100%; width: 100%;
aspect-ratio: 4 / 5; aspect-ratio: 3 / 2;
object-fit: cover; object-fit: cover;
background: var(--color-surface); background: var(--color-surface);
transition: transform 0.4s ease; transition: transform 0.4s ease;
+12
View File
@@ -105,10 +105,22 @@ const strings = computed(() => STRINGS[locale.value])
position: relative; position: relative;
} }
/* Stacked and centred above the wordmark on phones — there isn't room
beside the centred logo without overlapping it. Pinned to the corner
again once the header has space to spare. */
.lang-switch-header { .lang-switch-header {
display: flex;
justify-content: center;
margin-bottom: 0.75rem;
}
@media (min-width: 48rem) {
.lang-switch-header {
position: absolute; position: absolute;
top: 0; top: 0;
right: var(--space); right: var(--space);
margin-bottom: 0;
}
} }
.wordmark { .wordmark {
@@ -0,0 +1,35 @@
/// <reference path="../pb_data/types.d.ts" />
// One-time cleanup: replace every article's slug with a sequential
// "article-N", ordered by publishedAt (oldest first; drafts, which have no
// publishedAt, sort after published articles by creation order). Requested
// explicitly by the site owner, aware this drops the existing descriptive
// slugs and breaks any already-indexed/shared URLs using them.
//
// Two passes with a temporary unique slug in between: assigning final slugs
// in a single pass can collide with another record's current slug that
// hasn't been renamed yet (slug has a unique index).
migrate((app) => {
const articles = app.findAllRecords('articles')
articles.sort((a, b) => {
const publishedA = a.getString('publishedAt')
const publishedB = b.getString('publishedAt')
if (publishedA && publishedB) return publishedA < publishedB ? -1 : publishedA > publishedB ? 1 : 0
if (publishedA) return -1
if (publishedB) return 1
return a.getString('created') < b.getString('created') ? -1 : 1
})
articles.forEach((record) => {
record.set('slug', `migrating-${record.id}`)
app.save(record)
})
articles.forEach((record, index) => {
record.set('slug', `article-${index + 1}`)
app.save(record)
})
}, (_app) => {
// Not reversible: the original slugs aren't recorded anywhere.
})