Simplify home page and nav to a single latest-article link
Home now shows only the latest article, pointing to the full list on /blog instead of duplicating recent articles in a grid. Nav trims to Home, Tutti gli articoli, and the corralito page; the footer drops the now-redundant Categorie column.
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import type { Category } from '#shared/types/blog'
|
||||
|
||||
const { data: categories } = await useFetch<Category[]>('/api/categories', {
|
||||
key: 'nav-categories',
|
||||
default: () => [],
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -24,12 +18,8 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
|
||||
<nav class="site-nav" aria-label="Navigazione principale">
|
||||
<div class="container nav-inner">
|
||||
<ul>
|
||||
<li><NuxtLink to="/">Home</NuxtLink></li>
|
||||
<li><NuxtLink to="/blog">Tutti gli articoli</NuxtLink></li>
|
||||
<li v-for="category in categories" :key="category.slug">
|
||||
<NuxtLink :to="`/category/${category.slug}`">
|
||||
{{ category.name }}
|
||||
</NuxtLink>
|
||||
</li>
|
||||
<li><NuxtLink to="/come-difendersi-dal-corralito">Come difendersi dal corralito</NuxtLink></li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -51,18 +41,6 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
|
||||
</address>
|
||||
</div>
|
||||
|
||||
<nav class="footer-block" aria-label="Categorie">
|
||||
<p class="kicker">Categorie</p>
|
||||
<ul>
|
||||
<li v-for="category in categories" :key="category.slug">
|
||||
<NuxtLink :to="`/category/${category.slug}`">
|
||||
{{ category.name }}
|
||||
</NuxtLink>
|
||||
</li>
|
||||
<li v-if="!categories.length" class="muted">Ancora nessuna pubblicazione</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<nav class="footer-block" aria-label="Naviga">
|
||||
<p class="kicker">Naviga</p>
|
||||
<ul>
|
||||
|
||||
@@ -6,9 +6,7 @@ const { data, error } = await useFetch<Paginated<ArticleSummary>>('/api/articles
|
||||
query: { page: 1 },
|
||||
})
|
||||
|
||||
/** The newest article leads the page; the next six fill the grid below it. */
|
||||
const featured = computed(() => data.value?.items[0] ?? null)
|
||||
const rest = computed(() => data.value?.items.slice(1, 7) ?? [])
|
||||
|
||||
const mediaUrl = useMediaUrl()
|
||||
const featuredCover = computed(() => mediaUrl(featured.value?.cover))
|
||||
@@ -66,9 +64,6 @@ useSeoMeta({
|
||||
Le monete fiduciarie sono per loro natura cannibalizzanti. Oggi tocca all'euro.
|
||||
Anche perché le altre hanno praticamente perso tutte tutto.
|
||||
</p>
|
||||
<p class="landing-cta">
|
||||
<NuxtLink to="/come-difendersi-dal-corralito">Come difendersi dal corralito</NuxtLink>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -113,16 +108,6 @@ useSeoMeta({
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<template v-if="rest.length">
|
||||
<h2 class="section-heading kicker">Altri articoli</h2>
|
||||
|
||||
<ul class="card-grid">
|
||||
<li v-for="article in rest" :key="article.slug">
|
||||
<ArticleCard :article="article" />
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<p class="more">
|
||||
<NuxtLink to="/blog">Vedi tutti gli articoli</NuxtLink>
|
||||
</p>
|
||||
@@ -161,29 +146,6 @@ useSeoMeta({
|
||||
margin-top: 1.1rem;
|
||||
}
|
||||
|
||||
.landing-cta {
|
||||
margin-top: 1.75rem;
|
||||
text-align: center;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.14em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.landing-cta a {
|
||||
padding: 0.85rem 2.5rem;
|
||||
text-decoration: none;
|
||||
border: 1px solid var(--color-ink);
|
||||
color: var(--color-ink);
|
||||
display: inline-block;
|
||||
transition: background 0.2s ease, color 0.2s ease;
|
||||
}
|
||||
|
||||
.landing-cta a:hover {
|
||||
background: var(--color-ink);
|
||||
color: var(--color-bg);
|
||||
}
|
||||
|
||||
.featured {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
|
||||
Reference in New Issue
Block a user