Add numbered pagination and redesign the IT/EN language switch

Blog and category archives now show a numbered page list (first, last,
current +/-1, collapsing gaps into an ellipsis) instead of only
previous/next — see shared/utils/pagination.ts's paginationRange().

Renders page links via NuxtLink's custom/v-slot API rather than letting
it render its own <a>: RouterLink's built-in active-class/aria-current
detection compares only the route's path, not its query string, so
every ?page=N link was incorrectly marked as the current page.

The language switch now shows both "Italiano / English" at all times,
with the current one as plain non-interactive text and the other as a
link, moved to the header's top-right corner instead of stacked under
the logo.
This commit is contained in:
2026-09-11 14:31:58 +02:00
parent 364fda3980
commit 1247a2ca07
12 changed files with 369 additions and 67 deletions
+11 -2
View File
@@ -155,8 +155,17 @@ layout shift results.
prefix and date formatting.
- `app/components/SocialIcon.vue` — inlines SVG brand marks from `simple-icons` at build time
(`?raw` imports) rather than bundling the whole icon set.
- `app/components/LanguageSwitch.vue` — the header's language-switch link; reads
`useLangSwitchState()` and `useLocale()`, computes the equivalent path in the other language.
- `app/components/LanguageSwitch.vue` — the header's language toggle: both language names are
always shown (`Italiano / English`), the current one as plain non-interactive text
(`aria-current="true"`), the other as a link — reads `useLangSwitchState()` and `useLocale()` to
compute the target path, per the fallback rules in [English content](#english-content).
- `app/components/PaginationNav.vue` — numbered pagination (not just prev/next): first, last, the
current page and its immediate neighbors, collapsing gaps into a single `…` via
`shared/utils/pagination.ts`'s `paginationRange()`. Used by `BlogIndexView`/`CategoryView`.
Renders page links via `NuxtLink`'s `custom`/`v-slot` API rather than letting the component
render its own `<a>``RouterLink`'s built-in active-class/`aria-current` detection compares
only the route's `path`, not its query string, so with plain `NuxtLink`s every `?page=N` link
would end up (wrongly) marked as the current page.
- `app/components/views/*.vue` (`HomeView`, `BlogIndexView`, `ArticleView`, `CategoryView`) — the
actual page markup/logic, parametrized by a `locale` prop; the real `pages/**` and `pages/en/**`
files are thin wrappers around these (see [English content](#english-content)). Registered