release: v0.13.0 (#535)
Twenty-nine commits since v0.12.0. See CHANGELOG.md for the full list and the upgrade notes. Ten additions — the SEO package (site URL, robots.txt, sitemap.xml, JSON-LD), slideshow mode, opt-in original downloads, copy-link, previous/next album navigation, alt text from the Immich description, per-album location precision, the update notice, a Help tab, and a subpage cover grid separate from its photo grid. Two fixes: CJK album slugs, and the lightbox control bar. Photo of the Day (#476) was built on `dev` and reverted as not planned; it never appears in a release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmsHVRL9yQvckUB1ZpVWre --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: ralksta <ralksta@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,13 @@ vi.mock('@/lib/env', () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
import { slugify, buildSubpageGrid, sanitizeNavLinks } from '@/lib/config';
|
||||
import {
|
||||
slugify,
|
||||
albumSlug,
|
||||
normalizeSlug,
|
||||
buildSubpageGrid,
|
||||
sanitizeNavLinks,
|
||||
} from '@/lib/config';
|
||||
|
||||
// EXPERIMENTAL: external navigation links — rendered as <a href> in the
|
||||
// header, so only http(s) URLs may survive sanitisation.
|
||||
@@ -81,6 +87,64 @@ describe('slugify', () => {
|
||||
it('preserves numbers', () => {
|
||||
expect(slugify('Album 2024')).toBe('album-2024');
|
||||
});
|
||||
|
||||
// #522: stripping every non-ASCII character left CJK names with an empty
|
||||
// slug, so their links pointed at "/" and clicking an album did nothing.
|
||||
it('preserves CJK characters', () => {
|
||||
expect(slugify('家族相册')).toBe('家族相册');
|
||||
expect(slugify('写真')).toBe('写真');
|
||||
expect(slugify('旅行 2024')).toBe('旅行-2024');
|
||||
});
|
||||
|
||||
it('preserves Hangul in composed (NFC) form', () => {
|
||||
const slug = slugify('가족 앨범');
|
||||
expect(slug).toBe('가족-앨범');
|
||||
expect(slug).toBe(slug.normalize('NFC'));
|
||||
});
|
||||
|
||||
it('preserves other non-Latin scripts', () => {
|
||||
expect(slugify('Москва 2024')).toBe('москва-2024');
|
||||
});
|
||||
|
||||
it('still returns empty when nothing letter-like remains', () => {
|
||||
expect(slugify('🎉🎉')).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('albumSlug', () => {
|
||||
it('uses the slugified name when it yields something', () => {
|
||||
expect(albumSlug('Kloster Chorin', 'abc-123')).toBe('kloster-chorin');
|
||||
expect(albumSlug('家族相册', 'abc-123')).toBe('家族相册');
|
||||
});
|
||||
|
||||
// Without a fallback two emoji-only albums would both slugify to '' and
|
||||
// collide on the same (unreachable) URL.
|
||||
it('falls back to the album id when the name slugifies to nothing', () => {
|
||||
expect(albumSlug('🎉', 'abc-123')).toBe('abc-123');
|
||||
expect(albumSlug('', 'abc-123')).toBe('abc-123');
|
||||
});
|
||||
});
|
||||
|
||||
describe('normalizeSlug', () => {
|
||||
// Next hands catch-all route segments over percent-encoded, so this is the
|
||||
// half of #522 that fixing slugify() alone did not cure.
|
||||
it('percent-decodes an encoded slug', () => {
|
||||
expect(normalizeSlug('%E5%AE%B6%E6%97%8F%E7%9B%B8%E5%86%8C')).toBe('家族相册');
|
||||
});
|
||||
|
||||
it('leaves an already decoded slug alone', () => {
|
||||
expect(normalizeSlug('家族相册')).toBe('家族相册');
|
||||
expect(normalizeSlug('kloster-chorin')).toBe('kloster-chorin');
|
||||
});
|
||||
|
||||
it('composes decomposed (NFD) input', () => {
|
||||
expect(normalizeSlug('가족-앨범'.normalize('NFD'))).toBe('가족-앨범');
|
||||
});
|
||||
|
||||
it('survives a malformed percent sequence instead of throwing', () => {
|
||||
expect(() => normalizeSlug('%E5%AE')).not.toThrow();
|
||||
expect(normalizeSlug('100%-real')).toBe('100%-real');
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildSubpageGrid', () => {
|
||||
|
||||
Reference in New Issue
Block a user