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
+13 -8
View File
@@ -11,16 +11,15 @@ const strings = computed(() => STRINGS[locale.value])
<a class="skip-link" href="#main">{{ strings.skipLink }}</a>
<header class="site-header">
<div class="container">
<div class="container header-inner">
<LanguageSwitch class="lang-switch-header" />
<p class="wordmark">
<NuxtLink :to="localePath(locale, '/')">
<img src="/logo.png" :alt="SITE_NAME" width="400" height="400">
</NuxtLink>
</p>
<p class="tagline kicker">{{ strings.tagline }}</p>
<p class="lang-switch-header">
<LanguageSwitch />
</p>
</div>
<nav class="site-nav" :aria-label="strings.navAriaLabel">
@@ -102,6 +101,16 @@ const strings = computed(() => STRINGS[locale.value])
}
}
.header-inner {
position: relative;
}
.lang-switch-header {
position: absolute;
top: 0;
right: var(--space);
}
.wordmark {
margin: 0;
}
@@ -121,10 +130,6 @@ const strings = computed(() => STRINGS[locale.value])
margin-top: 0.6rem;
}
.lang-switch-header {
margin-top: 0.5rem;
}
.site-nav {
margin-top: 1.25rem;
border-top: 1px solid var(--color-border);