Compare commits

...
9 Commits
Author SHA1 Message Date
davide 0d56769388 Home: only latest article reachable via 'read the latest article' link 2026-08-28 08:27:57 +02:00
davide 91b61caa37 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.
2026-08-27 13:35:29 +02:00
davide b7bb664c95 Add landing page content and a courses page, restyle both
Turn the home page into a single-column feature: a lead image, the
opening statement as the page's sole h1, a second image, and the body
copy, with the existing latest-articles section still below. Add a new
static page for the crypto courses pitch ("come difendersi dal
corralito"), styled like an article with a cover image and a contact
CTA (email + Telegram) instead of the referenced but nonexistent
contact form. Link the new page from the header nav and footer.
2026-08-26 10:46:46 +02:00
davide 809b60d85e Remove i18n, keep only Italian and rely on browser translation
The interface was translated in en/it/es/fr via @nuxtjs/i18n. Drop the
module, the locale files, and the language switcher: the UI is now
static Italian text, with translation for foreign visitors left to the
Google Translate browser extension instead of the app.
2026-08-26 09:39:05 +02:00
davide 448dd881e4 Ignore ops/ (holds VPS credentials, never commit) 2026-08-25 20:07:09 +02:00
davide 8021ea7254 Route every Strapi plugin path to the CMS, not just /admin
Strapi mounts each plugin's admin API at its own top-level path
(/content-manager, /upload, /i18n, ...), not nested under /admin as
previously assumed. That broke the dashboard widgets: recent/count
documents calls landed on the frontend instead of Strapi. List every
prefix actually used by the installed plugins (core-bundled ones plus
users-permissions and cloud from cms/package.json) explicitly in the
Caddyfile.
2026-08-25 20:06:40 +02:00
davide e927396505 Serve the CMS admin panel under /admin on the public domain
Replace the separate CMS subdomain with path-based routing in Caddy:
/admin and /uploads go to Strapi, everything else to the frontend.
Strapi 5 nests its whole admin panel (UI and API) under /admin, so this
one prefix is enough and never collides with the frontend's own /api
routes. Drops CMS_DOMAIN and the unused STRAPI_URL env var on the cms
service; PUBLIC_STRAPI_URL now points at the same origin as the site.

Authentication is unchanged: Strapi's own admin login still gates the
panel, this only changes how it's reached.
2026-08-25 19:49:37 +02:00
davide cb29c68d75 Fix ACME DNS resolution failures in the caddy container
The host's systemd-resolved stub (127.0.0.53) is unreachable from inside
the container network namespace, so Caddy could not resolve Let's Encrypt
endpoints. Point it at public resolvers instead.
2026-08-25 19:23:56 +02:00
davide 071bc1eaa5 Make the site responsive for phones, tablets, and desktop
Mobile-first layout with breakpoints at 48rem (tablet) and 64rem (desktop):
stacked nav on phones, progressive column counts for the article grid and
footer, scrollable markdown tables, larger tap targets on nav links.
2026-08-25 19:04:40 +02:00
28 changed files with 464 additions and 3296 deletions

No files matched your search

+2 -2
View File
@@ -2,7 +2,6 @@
# --- Domains (Caddy) --- # --- Domains (Caddy) ---
PUBLIC_DOMAIN=blog.localhost PUBLIC_DOMAIN=blog.localhost
CMS_DOMAIN=cms.blog.localhost
ACME_EMAIL=admin@example.com ACME_EMAIL=admin@example.com
# --- Database --- # --- Database ---
@@ -25,4 +24,5 @@ STRAPI_URL=http://cms:1337
# Public base URL of the website, used for canonical URLs and Open Graph. # Public base URL of the website, used for canonical URLs and Open Graph.
PUBLIC_SITE_URL=https://blog.localhost PUBLIC_SITE_URL=https://blog.localhost
# Public base URL of Strapi, used to build absolute media URLs in the browser. # Public base URL of Strapi, used to build absolute media URLs in the browser.
PUBLIC_STRAPI_URL=https://cms.blog.localhost # Same origin as PUBLIC_SITE_URL: Caddy proxies /admin and /uploads to Strapi.
PUBLIC_STRAPI_URL=https://blog.localhost
+3
View File
@@ -10,6 +10,9 @@ node_modules/
*.pem *.pem
*.key *.key
# ops (holds VPS credentials, never commit)
ops/
# nuxt # nuxt
frontend/.nuxt/ frontend/.nuxt/
frontend/.output/ frontend/.output/
+22 -11
View File
@@ -16,24 +16,35 @@ sitemap e `robots.txt` dinamici, ricerca, e i test (nessun framework ancora conf
## Architettura ## Architettura
```text ```text
Browser → Caddy ─┬─ dominio pubblico → Nuxt 4 (SSR) → REST Strapi Browser → Caddy ─┬─ /admin e i path dei plugin Strapi → Strapi 5 → PostgreSQL
└─ sottodominio CMS → Strapi 5 → PostgreSQL └─ tutto il resto → Nuxt 4 (SSR) → REST Strapi
``` ```
Caddy instrada per **path**, non per sottodominio: `PUBLIC_DOMAIN` serve sia il sito che il
pannello Strapi. Ogni plugin Strapi monta la propria API admin sul proprio path di primo
livello, non tutto sotto `/admin` (es. `/content-manager`, `/upload`, `/i18n`...): l'elenco
completo dei prefissi da instradare a Strapi vive nel `Caddyfile`. Se aggiungi un plugin
Strapi, aggiungi il suo prefisso lì. Niente di questo tocca `/api`, riservato agli endpoint
Nitro del frontend. Un solo dominio, un solo certificato TLS.
- Strapi è la **sola** fonte di verità editoriale. Niente altro backend (no Express/Nest/Fastify): - Strapi è la **sola** fonte di verità editoriale. Niente altro backend (no Express/Nest/Fastify):
se serve logica server, sta in Nitro (`frontend/server/`) o in un controller Strapi. se serve logica server, sta in Nitro (`frontend/server/`) o in un controller Strapi.
- I visitatori pubblici non si autenticano mai. Solo editor/admin usano l'auth Strapi. - I visitatori pubblici non si autenticano mai. Solo editor/admin usano l'auth Strapi.
- **Il browser non parla mai con Strapi.** Le pagine chiamano gli endpoint Nitro in - **Il browser dei visitatori pubblici non parla mai con Strapi.** Le pagine chiamano gli
`frontend/server/api/`, che sono l'unico posto dove si costruiscono query Strapi. Così endpoint Nitro in `frontend/server/api/`, che sono l'unico posto dove si costruiscono
`NUXT_STRAPI_URL` resta l'indirizzo interno Docker, niente CORS e niente token nel client. query Strapi. Così `NUXT_STRAPI_URL` resta l'indirizzo interno Docker, niente CORS e
Se aggiungi una vista, aggiungi l'endpoint lì e tipizza il ritorno in `shared/types/blog.ts`. niente token nel client. Se aggiungi una vista, aggiungi l'endpoint lì e tipizza il
ritorno in `shared/types/blog.ts`. Fanno eccezione, per costruzione: l'admin panel
(`/admin`, uso editor/admin autenticato) e le immagini cover, che il browser carica
direttamente da `PUBLIC_STRAPI_URL` (`/uploads/...`, sola lettura, nessun'autenticazione
richiesta né concessa).
- Il Markdown dell'articolo è convertito in HTML **nell'endpoint**, non nel componente: il - Il Markdown dell'articolo è convertito in HTML **nell'endpoint**, non nel componente: il
contenuto è già nell'HTML SSR e `marked` resta fuori dal bundle client. contenuto è già nell'HTML SSR e `marked` resta fuori dal bundle client.
- L'**interfaccia** è tradotta in en/it/es/fr con `@nuxtjs/i18n`: stringhe in - L'**interfaccia** è solo in italiano, stringhe statiche nei componenti (niente
`frontend/i18n/locales/*.json`, rotte `prefix_except_default` (inglese senza prefisso), `@nuxtjs/i18n`, niente file di traduzione): `<html lang="it">` è fisso in
`hreflang` e `og:locale` generati da `useLocaleHead()` in `app.vue`. Nessuna stringa `nuxt.config.ts`. La traduzione per i visitatori stranieri è delegata all'estensione
visibile va scritta a mano in un componente: aggiungi la chiave nei quattro file. Google Translate del browser, non è gestita dall'app. I **contenuti** restano
I **contenuti** invece restano monolingua — la localizzazione di Strapi è disattivata. monolingua — la localizzazione di Strapi è disattivata.
- `cms/src/index.ts` (`bootstrap`) dà al ruolo Public solo `find`/`findOne` su Article e Category, - `cms/src/index.ts` (`bootstrap`) dà al ruolo Public solo `find`/`findOne` su Article e Category,
e disattiva la registrazione pubblica: non esistono utenti front-end, solo amministratori. e disattiva la registrazione pubblica: non esistono utenti front-end, solo amministratori.
Qualsiasi permesso in più va motivato. Qualsiasi permesso in più va motivato.
+13 -14
View File
@@ -4,8 +4,8 @@ Blog platform: a public website built with Nuxt, and a private Strapi CMS where
articles are written. Everything runs behind Caddy via Docker Compose. articles are written. Everything runs behind Caddy via Docker Compose.
```text ```text
Browser → Caddy ─┬─ public domain → Nuxt (website) Browser → Caddy ─┬─ /admin and Strapi's plugin paths → Strapi (CMS) → PostgreSQL
└─ cms subdomain → Strapi (CMS) → PostgreSQL └─ everything else → Nuxt (website)
``` ```
There are no front-end accounts: sign-up is disabled and only administrators write There are no front-end accounts: sign-up is disabled and only administrators write
@@ -46,7 +46,8 @@ The first build takes a few minutes. `docker-compose.dev.yml` publishes the port
`127.0.0.1` and leaves Caddy out; it must always be passed explicitly, so it can never be `127.0.0.1` and leaves Caddy out; it must always be passed explicitly, so it can never be
picked up by accident in production. picked up by accident in production.
**4. Create the administrator account** at http://localhost:1337/admin. This is the first **4. Create the administrator account** at http://localhost:1337/admin (dev bypasses Caddy,
so the CMS is reached directly on its port). This is the first
run, so the form creates the account — pick your own credentials. run, so the form creates the account — pick your own credentials.
**5. Write something.** In the admin panel: create a **Category**, then an **Article** **5. Write something.** In the admin panel: create a **Category**, then an **Article**
@@ -72,16 +73,15 @@ override it with `NUXT_STRAPI_URL` if needed. Strapi reads its own `cms/.env`.
## Production ## Production
**1. Point the DNS at the server.** Two `A` records (and `AAAA` if you have IPv6) on the **1. Point the DNS at the server.** One `A` record (and `AAAA` if you have IPv6) on the
public IP of the machine: public IP of the machine:
| Record | Purpose | | Record | Purpose |
|---|---| |---|---|
| `example.com` | the website | | `example.com` | the website and, at `/admin`, the Strapi admin panel |
| `cms.example.com` | the Strapi admin panel |
Wait for the records to resolve before starting the stack — Caddy requests the Wait for the record to resolve before starting the stack — Caddy requests the
certificates on the first boot and a failed challenge means a retry delay. certificate on the first boot and a failed challenge means a retry delay.
**2. Open the firewall** for ports `80` and `443` only. Port `80` is required: Caddy uses **2. Open the firewall** for ports `80` and `443` only. Port `80` is required: Caddy uses
it for the ACME challenge and to redirect to HTTPS. PostgreSQL, Strapi and Nuxt are only it for the ACME challenge and to redirect to HTTPS. PostgreSQL, Strapi and Nuxt are only
@@ -92,10 +92,9 @@ reachable inside the Docker network — do not publish their ports.
| Variable | Value | | Variable | Value |
|---|---| |---|---|
| `PUBLIC_DOMAIN` | `example.com` | | `PUBLIC_DOMAIN` | `example.com` |
| `CMS_DOMAIN` | `cms.example.com` |
| `ACME_EMAIL` | a mailbox you read — Let's Encrypt sends expiry warnings there | | `ACME_EMAIL` | a mailbox you read — Let's Encrypt sends expiry warnings there |
| `PUBLIC_SITE_URL` | `https://example.com` | | `PUBLIC_SITE_URL` | `https://example.com` |
| `PUBLIC_STRAPI_URL` | `https://cms.example.com` | | `PUBLIC_STRAPI_URL` | `https://example.com` — same origin, Caddy proxies `/admin` and Strapi's other plugin paths there (see `caddy/Caddyfile`) |
| `STRAPI_URL` | leave it as `http://cms:1337` — internal address, never public | | `STRAPI_URL` | leave it as `http://cms:1337` — internal address, never public |
Then generate **fresh** secrets on that machine with the same loop as in development — Then generate **fresh** secrets on that machine with the same loop as in development —
@@ -112,11 +111,11 @@ already ignored.
docker compose up -d --build docker compose up -d --build
``` ```
This time Caddy is included: it serves the website on `PUBLIC_DOMAIN`, the CMS on This time Caddy is included: it serves both the website and, under `/admin` and Strapi's
`CMS_DOMAIN`, obtains and renews the TLS certificates on its own, and adds HSTS and the other plugin paths, the CMS on `PUBLIC_DOMAIN`, obtains and renews the TLS certificate on
other security headers. its own, and adds HSTS and the other security headers.
**5. Create the administrator account** at `https://cms.example.com/admin`, immediately, **5. Create the administrator account** at `https://example.com/admin`, immediately,
before anyone else finds the URL — the first visitor to that form is the one who gets the before anyone else finds the URL — the first visitor to that form is the one who gets the
account. Then publish as in development. account. Then publish as in development.
+22 -9
View File
@@ -15,15 +15,28 @@
{$PUBLIC_DOMAIN} { {$PUBLIC_DOMAIN} {
import security_headers import security_headers
encode zstd gzip encode zstd gzip
reverse_proxy frontend:3000
}
{$CMS_DOMAIN} { # Strapi mounts each of its (and its plugins') admin APIs at its own
import security_headers # top-level path, not all under /admin - the admin panel's dashboard
encode zstd gzip # widgets, media library, i18n, etc each call their own plugin prefix.
# Uploaded media can be large; Strapi's own limit still applies. # This list is every @strapi/* package in cms/package.json plus the
request_body { # core-bundled plugins (content-manager, content-type-builder, upload,
max_size 100MB # i18n, email, content-releases, review-workflows). Adding a new Strapi
# plugin later means adding its prefix here too.
# None of this touches /api, reserved for the frontend's own Nitro
# endpoints.
@cms path /admin* /content-manager* /content-type-builder* /upload*\
/i18n* /email* /content-releases* /review-workflows*\
/users-permissions* /cloud*
handle @cms {
# Uploaded media can be large; Strapi's own limit still applies.
request_body {
max_size 100MB
}
reverse_proxy cms:1337
}
handle {
reverse_proxy frontend:3000
} }
reverse_proxy cms:1337
} }
-3
View File
@@ -9,8 +9,6 @@ services:
cms: cms:
ports: ports:
- "127.0.0.1:1337:1337" - "127.0.0.1:1337:1337"
environment:
STRAPI_URL: http://localhost:1337
frontend: frontend:
ports: ports:
@@ -18,4 +16,3 @@ services:
environment: environment:
NUXT_PUBLIC_SITE_URL: http://localhost:3000 NUXT_PUBLIC_SITE_URL: http://localhost:3000
NUXT_PUBLIC_STRAPI_URL: http://localhost:1337 NUXT_PUBLIC_STRAPI_URL: http://localhost:1337
NUXT_PUBLIC_I18N_BASE_URL: http://localhost:3000
+5 -4
View File
@@ -36,7 +36,6 @@ services:
TRANSFER_TOKEN_SALT: ${TRANSFER_TOKEN_SALT} TRANSFER_TOKEN_SALT: ${TRANSFER_TOKEN_SALT}
JWT_SECRET: ${JWT_SECRET} JWT_SECRET: ${JWT_SECRET}
ENCRYPTION_KEY: ${ENCRYPTION_KEY} ENCRYPTION_KEY: ${ENCRYPTION_KEY}
STRAPI_URL: https://${CMS_DOMAIN}
volumes: volumes:
- cms-uploads:/app/public/uploads - cms-uploads:/app/public/uploads
@@ -52,8 +51,6 @@ services:
NUXT_STRAPI_URL: ${STRAPI_URL} NUXT_STRAPI_URL: ${STRAPI_URL}
NUXT_PUBLIC_SITE_URL: ${PUBLIC_SITE_URL} NUXT_PUBLIC_SITE_URL: ${PUBLIC_SITE_URL}
NUXT_PUBLIC_STRAPI_URL: ${PUBLIC_STRAPI_URL} NUXT_PUBLIC_STRAPI_URL: ${PUBLIC_STRAPI_URL}
# Absolute origin for the alternate-language links.
NUXT_PUBLIC_I18N_BASE_URL: ${PUBLIC_SITE_URL}
caddy: caddy:
image: caddy:2-alpine image: caddy:2-alpine
@@ -64,9 +61,13 @@ services:
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
# Host uses systemd-resolved (127.0.0.53), unreachable from inside the
# container network namespace; ACME lookups need a real resolver.
dns:
- 1.1.1.1
- 8.8.8.8
environment: environment:
PUBLIC_DOMAIN: ${PUBLIC_DOMAIN} PUBLIC_DOMAIN: ${PUBLIC_DOMAIN}
CMS_DOMAIN: ${CMS_DOMAIN}
ACME_EMAIL: ${ACME_EMAIL} ACME_EMAIL: ${ACME_EMAIL}
volumes: volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro - ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
-5
View File
@@ -1,8 +1,3 @@
<script setup lang="ts">
// Emits <html lang>, the alternate-language links and og:locale for every page.
useHead(useLocaleHead())
</script>
<template> <template>
<div> <div>
<NuxtRouteAnnouncer /> <NuxtRouteAnnouncer />
+42 -9
View File
@@ -13,8 +13,18 @@
--width: 76rem; --width: 76rem;
--width-prose: 40rem; --width-prose: 40rem;
--space: 1.5rem;
--radius: 2px; --radius: 2px;
/* Breakpoints used throughout: 48rem = tablet, 64rem = desktop. */
--space: 1.1rem;
--gap-section: 2.5rem;
}
@media (min-width: 48rem) {
:root {
--space: 1.5rem;
--gap-section: 4rem;
}
} }
*, *,
@@ -99,7 +109,7 @@ h3 {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 1.25rem; gap: 1.25rem;
margin-block: 4rem 2rem; margin-block: var(--gap-section) 1.75rem;
} }
.section-heading::after { .section-heading::after {
@@ -111,8 +121,8 @@ h3 {
/* Centred title block at the top of a listing page. */ /* Centred title block at the top of a listing page. */
.page-header { .page-header {
margin-bottom: 3.5rem; margin-bottom: var(--gap-section);
padding-bottom: 2rem; padding-bottom: 1.75rem;
text-align: center; text-align: center;
border-bottom: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
} }
@@ -127,17 +137,40 @@ h3 {
.card-grid { .card-grid {
display: grid; display: grid;
gap: 3rem 2.5rem; gap: 2.25rem 1.5rem;
grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); /* One column on phones, two on tablets, three or more on wide screens. */
grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
padding: 0; padding: 0;
margin: 0; margin: 0;
list-style: none; list-style: none;
} }
@media (min-width: 48rem) {
.card-grid {
gap: 3rem 2.5rem;
}
}
/* Article body */ /* Article body */
.prose { .prose {
max-width: var(--width-prose); max-width: var(--width-prose);
font-size: 1.075rem; font-size: 1.0125rem;
/* Editors paste long URLs; without this they push the page sideways. */
overflow-wrap: break-word;
}
@media (min-width: 48rem) {
.prose {
font-size: 1.075rem;
}
}
/* Markdown tables have no wrapper to scroll, so the table scrolls itself. */
.prose table {
display: block;
max-width: 100%;
overflow-x: auto;
border-collapse: collapse;
} }
.prose h2, .prose h2,
@@ -193,10 +226,10 @@ h3 {
.pagination { .pagination {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 2rem; gap: 1rem 2rem;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 4rem; margin-top: var(--gap-section);
padding-top: 2rem; padding-top: 2rem;
border-top: 1px solid var(--color-border); border-top: 1px solid var(--color-border);
font-size: 0.85rem; font-size: 0.85rem;
+10 -12
View File
@@ -3,21 +3,22 @@ import type { ArticleSummary } from '#shared/types/blog'
const props = defineProps<{ article: ArticleSummary }>() const props = defineProps<{ article: ArticleSummary }>()
const { locale } = useI18n()
const mediaUrl = useMediaUrl() const mediaUrl = useMediaUrl()
const cover = computed(() => mediaUrl(props.article.cover)) const cover = computed(() => mediaUrl(props.article.cover))
</script> </script>
<template> <template>
<article class="card"> <article class="card">
<NuxtLinkLocale <!-- No placeholder box when there is no cover: an empty grey rectangle
reads as a broken image rather than as a deliberate choice. -->
<NuxtLink
v-if="cover"
class="cover-link" class="cover-link"
:to="`/blog/${article.slug}`" :to="`/blog/${article.slug}`"
tabindex="-1" tabindex="-1"
aria-hidden="true" aria-hidden="true"
> >
<img <img
v-if="cover"
class="cover" class="cover"
:src="cover" :src="cover"
:alt="article.cover?.alternativeText ?? ''" :alt="article.cover?.alternativeText ?? ''"
@@ -25,18 +26,17 @@ const cover = computed(() => mediaUrl(props.article.cover))
:height="article.cover?.height ?? undefined" :height="article.cover?.height ?? undefined"
loading="lazy" loading="lazy"
> >
<span v-else class="cover placeholder" /> </NuxtLink>
</NuxtLinkLocale>
<p v-if="article.category" class="kicker">{{ article.category.name }}</p> <p v-if="article.category" class="kicker">{{ article.category.name }}</p>
<h2> <h2>
<NuxtLinkLocale :to="`/blog/${article.slug}`">{{ article.title }}</NuxtLinkLocale> <NuxtLink :to="`/blog/${article.slug}`">{{ article.title }}</NuxtLink>
</h2> </h2>
<p class="kicker date"> <p class="kicker date">
<time :datetime="isoDate(article.publishedAt)"> <time :datetime="isoDate(article.publishedAt)">
{{ formatDate(article.publishedAt, locale) }} {{ formatDate(article.publishedAt) }}
</time> </time>
</p> </p>
</article> </article>
@@ -60,11 +60,9 @@ const cover = computed(() => mediaUrl(props.article.cover))
transform: scale(1.03); transform: scale(1.03);
} }
.placeholder { /* Without a cover the kicker leads the card, so it needs no offset. */
display: block; .cover-link + .kicker,
} .cover-link + h2 {
.kicker {
margin-top: 1.1rem; margin-top: 1.1rem;
} }
@@ -1,71 +0,0 @@
<script setup lang="ts">
const { locale, locales, t } = useI18n()
const switchLocalePath = useSwitchLocalePath()
const router = useRouter()
/**
* A native select: it gets keyboard support, the platform picker on mobile and
* correct labelling for free, which a hand-built dropdown would have to rebuild.
*/
function onChange(event: Event) {
const code = (event.target as HTMLSelectElement).value as typeof locale.value
const path = switchLocalePath(code)
if (path) router.push(path)
}
</script>
<template>
<div class="switcher">
<label class="visually-hidden" for="locale-select">{{ t('site.languageLabel') }}</label>
<select id="locale-select" :value="locale" @change="onChange">
<option v-for="option in locales" :key="option.code" :value="option.code">
{{ option.name }}
</option>
</select>
<span class="arrow" aria-hidden="true">▾</span>
</div>
</template>
<style scoped>
.switcher {
position: relative;
display: inline-flex;
align-items: center;
}
select {
appearance: none;
padding: 0.35rem 1.6rem 0.35rem 0.7rem;
border: 1px solid var(--color-border);
border-radius: 0;
background: transparent;
color: var(--color-body);
font: inherit;
font-size: 0.75rem;
font-weight: 600;
letter-spacing: 0.14em;
text-transform: uppercase;
cursor: pointer;
}
select:hover {
border-color: var(--color-ink);
color: var(--color-ink);
}
.arrow {
position: absolute;
right: 0.6rem;
font-size: 0.65rem;
pointer-events: none;
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
</style>
+5 -4
View File
@@ -5,20 +5,21 @@ const props = defineProps<{ error: NuxtError }>()
const isNotFound = computed(() => props.error.statusCode === 404) const isNotFound = computed(() => props.error.statusCode === 404)
useHead(useLocaleHead())
useSeoMeta({ robots: 'noindex' }) useSeoMeta({ robots: 'noindex' })
</script> </script>
<template> <template>
<NuxtLayout> <NuxtLayout>
<h1>{{ isNotFound ? $t('error.notFoundTitle') : $t('error.genericTitle') }}</h1> <h1>{{ isNotFound ? 'Pagina non trovata' : 'Qualcosa è andato storto' }}</h1>
<p class="muted"> <p class="muted">
{{ isNotFound ? $t('error.notFoundBody') : $t('error.genericBody') }} {{ isNotFound
? 'La pagina che cerchi non esiste o è stata spostata.'
: 'Riprova tra qualche istante.' }}
</p> </p>
<p> <p>
<NuxtLinkLocale to="/">{{ $t('error.backHome') }}</NuxtLinkLocale> <NuxtLink to="/">Torna alla home</NuxtLink>
</p> </p>
</NuxtLayout> </NuxtLayout>
</template> </template>
+71 -54
View File
@@ -1,39 +1,27 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Category } from '#shared/types/blog'
const { locale } = useI18n()
const { data: categories } = await useFetch<Category[]>('/api/categories', {
key: 'nav-categories',
default: () => [],
})
</script> </script>
<template> <template>
<div class="page"> <div class="page">
<a class="skip-link" href="#main">{{ $t('site.skipToContent') }}</a> <a class="skip-link" href="#main">Vai al contenuto</a>
<header class="site-header"> <header class="site-header">
<div class="container"> <div class="container">
<p class="wordmark"> <p class="wordmark">
<NuxtLinkLocale to="/"> <NuxtLink to="/">
<img src="/logo.png" :alt="SITE_NAME" width="400" height="400"> <img src="/logo.png" :alt="SITE_NAME" width="400" height="400">
</NuxtLinkLocale> </NuxtLink>
</p> </p>
<p class="tagline kicker">{{ $t('site.tagline') }}</p> <p class="tagline kicker">Articoli, guide e analisi.</p>
</div> </div>
<nav class="site-nav" :aria-label="$t('site.mainNavigation')"> <nav class="site-nav" aria-label="Navigazione principale">
<div class="container nav-inner"> <div class="container nav-inner">
<ul> <ul>
<li><NuxtLinkLocale to="/blog">{{ $t('site.allArticles') }}</NuxtLinkLocale></li> <li><NuxtLink to="/">Home</NuxtLink></li>
<li v-for="category in categories" :key="category.slug"> <li><NuxtLink to="/blog">Tutti gli articoli</NuxtLink></li>
<NuxtLinkLocale :to="`/category/${category.slug}`"> <li><NuxtLink to="/come-difendersi-dal-corralito">Come difendersi dal corralito</NuxtLink></li>
{{ category.name }}
</NuxtLinkLocale>
</li>
</ul> </ul>
<LanguageSwitcher />
</div> </div>
</nav> </nav>
</header> </header>
@@ -46,35 +34,24 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
<div class="container footer-inner"> <div class="container footer-inner">
<div class="footer-block"> <div class="footer-block">
<img class="footer-logo" src="/logo.png" :alt="SITE_NAME" width="400" height="400"> <img class="footer-logo" src="/logo.png" :alt="SITE_NAME" width="400" height="400">
<p class="muted">{{ $t('site.tagline') }}</p> <p class="muted">Articoli, guide e analisi.</p>
<address class="contact"> <address class="contact">
{{ $t('site.contact') }}: Contatti:
<a :href="`mailto:${SITE_EMAIL}`">{{ SITE_EMAIL }}</a> <a :href="`mailto:${SITE_EMAIL}`">{{ SITE_EMAIL }}</a>
</address> </address>
</div> </div>
<nav class="footer-block" :aria-label="$t('site.categories')"> <nav class="footer-block" aria-label="Naviga">
<p class="kicker">{{ $t('site.categories') }}</p> <p class="kicker">Naviga</p>
<ul> <ul>
<li v-for="category in categories" :key="category.slug"> <li><NuxtLink to="/">Home</NuxtLink></li>
<NuxtLinkLocale :to="`/category/${category.slug}`"> <li><NuxtLink to="/blog">Tutti gli articoli</NuxtLink></li>
{{ category.name }} <li><NuxtLink to="/come-difendersi-dal-corralito">Come difendersi dal corralito</NuxtLink></li>
</NuxtLinkLocale>
</li>
<li v-if="!categories.length" class="muted">{{ $t('site.noCategories') }}</li>
</ul> </ul>
</nav> </nav>
<nav class="footer-block" :aria-label="$t('site.browse')"> <nav class="footer-block" aria-label="Seguici">
<p class="kicker">{{ $t('site.browse') }}</p> <p class="kicker">Seguici</p>
<ul>
<li><NuxtLinkLocale to="/">{{ $t('site.home') }}</NuxtLinkLocale></li>
<li><NuxtLinkLocale to="/blog">{{ $t('site.allArticles') }}</NuxtLinkLocale></li>
</ul>
</nav>
<nav class="footer-block" :aria-label="$t('site.follow')">
<p class="kicker">{{ $t('site.follow') }}</p>
<ul> <ul>
<li v-for="social in SOCIAL_LINKS" :key="social.name"> <li v-for="social in SOCIAL_LINKS" :key="social.name">
<a class="social" :href="social.url" target="_blank" rel="noopener me"> <a class="social" :href="social.url" target="_blank" rel="noopener me">
@@ -86,8 +63,8 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
</nav> </nav>
</div> </div>
<p class="container copyright kicker" :lang="locale"> <p class="container copyright kicker">
&copy; {{ new Date().getFullYear() }} {{ SITE_NAME }}. {{ $t('site.rights') }} &copy; {{ new Date().getFullYear() }} {{ SITE_NAME }}. Tutti i diritti riservati.
</p> </p>
</footer> </footer>
</div> </div>
@@ -102,11 +79,17 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
/* Header: centred wordmark over a thin rule of links. */ /* Header: centred wordmark over a thin rule of links. */
.site-header { .site-header {
padding-top: 2.5rem; padding-top: 1.5rem;
text-align: center; text-align: center;
border-bottom: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
} }
@media (min-width: 48rem) {
.site-header {
padding-top: 2.5rem;
}
}
.wordmark { .wordmark {
margin: 0; margin: 0;
} }
@@ -127,23 +110,20 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
} }
.site-nav { .site-nav {
margin-top: 2rem; margin-top: 1.25rem;
border-top: 1px solid var(--color-border); border-top: 1px solid var(--color-border);
} }
.nav-inner { .nav-inner {
display: flex; display: flex;
flex-wrap: wrap; justify-content: center;
gap: 0.75rem 2rem; padding-block: 0.6rem;
align-items: center;
justify-content: space-between;
padding-block: 0.9rem;
} }
.site-nav ul { .site-nav ul {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.25rem 2rem; gap: 0 1.25rem;
justify-content: center; justify-content: center;
padding: 0; padding: 0;
margin: 0; margin: 0;
@@ -154,10 +134,26 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
text-transform: uppercase; text-transform: uppercase;
} }
@media (min-width: 48rem) {
.site-nav {
margin-top: 2rem;
}
.nav-inner {
padding-block: 0.9rem;
}
.site-nav ul {
gap: 0.25rem 2rem;
}
}
.site-nav a { .site-nav a {
display: inline-block;
text-decoration: none; text-decoration: none;
color: var(--color-body); color: var(--color-body);
padding-block: 0.25rem; /* Roomy enough to tap accurately on a phone. */
padding-block: 0.6rem;
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
} }
@@ -169,7 +165,13 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
.site-main { .site-main {
flex: 1; flex: 1;
padding-block: 3.5rem 5rem; padding-block: 2.25rem 3.5rem;
}
@media (min-width: 48rem) {
.site-main {
padding-block: 3.5rem 5rem;
}
} }
/* Footer: columns, then a centred copyright line. */ /* Footer: columns, then a centred copyright line. */
@@ -179,13 +181,28 @@ const { data: categories } = await useFetch<Category[]>('/api/categories', {
border-top: 1px solid var(--color-border); border-top: 1px solid var(--color-border);
} }
/* One column on phones, two on tablets, four on desktop — auto-fit would
otherwise leave the fourth block stranded on its own row on a tablet. */
.footer-inner { .footer-inner {
display: grid; display: grid;
gap: 2.5rem; gap: 2rem;
grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); grid-template-columns: 1fr;
padding-bottom: 2.5rem; padding-bottom: 2.5rem;
} }
@media (min-width: 48rem) {
.footer-inner {
grid-template-columns: repeat(2, 1fr);
gap: 2.5rem;
}
}
@media (min-width: 64rem) {
.footer-inner {
grid-template-columns: repeat(4, 1fr);
}
}
.footer-block p:last-of-type { .footer-block p:last-of-type {
margin-bottom: 0; margin-bottom: 0;
} }
+14 -9
View File
@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Article } from '#shared/types/blog' import type { Article } from '#shared/types/blog'
const { locale } = useI18n()
const route = useRoute() const route = useRoute()
const slug = route.params.slug as string const slug = route.params.slug as string
@@ -53,13 +52,13 @@ useHead({
<template> <template>
<article v-if="article"> <article v-if="article">
<header class="article-header"> <header class="article-header">
<nav class="kicker" :aria-label="$t('article.breadcrumb')"> <nav class="kicker" aria-label="Percorso di navigazione">
<NuxtLinkLocale to="/blog">{{ $t('list.articles') }}</NuxtLinkLocale> <NuxtLink to="/blog">Articoli</NuxtLink>
<template v-if="article.category"> <template v-if="article.category">
<span aria-hidden="true"> / </span> <span aria-hidden="true"> / </span>
<NuxtLinkLocale :to="`/category/${article.category.slug}`"> <NuxtLink :to="`/category/${article.category.slug}`">
{{ article.category.name }} {{ article.category.name }}
</NuxtLinkLocale> </NuxtLink>
</template> </template>
</nav> </nav>
@@ -67,11 +66,11 @@ useHead({
<p class="kicker date"> <p class="kicker date">
<time :datetime="isoDate(article.publishedAt)"> <time :datetime="isoDate(article.publishedAt)">
{{ formatDateTime(article.publishedAt, locale) }} {{ formatDateTime(article.publishedAt) }}
</time> </time>
<template v-if="article.author"> <template v-if="article.author">
<span aria-hidden="true"> · </span> <span aria-hidden="true"> · </span>
<span>{{ $t('article.by', { name: article.author }) }}</span> <span>Di {{ article.author }}</span>
</template> </template>
</p> </p>
</header> </header>
@@ -89,7 +88,7 @@ useHead({
<div class="prose" v-html="article.html" /> <div class="prose" v-html="article.html" />
<p class="back"> <p class="back">
<NuxtLinkLocale to="/blog">{{ $t('article.back') }}</NuxtLinkLocale> <NuxtLink to="/blog">Torna a tutti gli articoli</NuxtLink>
</p> </p>
</article> </article>
</template> </template>
@@ -99,10 +98,16 @@ useHead({
max-width: 46rem; max-width: 46rem;
/* The gap below the header lives here, not on the cover: an article without /* The gap below the header lives here, not on the cover: an article without
a cover image would otherwise have its body butting against the byline. */ a cover image would otherwise have its body butting against the byline. */
margin: 0 auto 3rem; margin: 0 auto 2rem;
text-align: center; text-align: center;
} }
@media (min-width: 48rem) {
.article-header {
margin-bottom: 3rem;
}
}
.article-header nav a { .article-header nav a {
text-decoration: none; text-decoration: none;
} }
+11 -12
View File
@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ArticleSummary, Paginated } from '#shared/types/blog' import type { ArticleSummary, Paginated } from '#shared/types/blog'
const { t } = useI18n()
const route = useRoute() const route = useRoute()
const page = computed(() => { const page = computed(() => {
@@ -19,8 +18,8 @@ const canonical = computed(
) )
useSeoMeta({ useSeoMeta({
title: () => (page.value > 1 ? t('list.articlesPage', { page: page.value }) : t('list.articles')), title: () => (page.value > 1 ? `Articoli — pagina ${page.value}` : 'Articoli'),
description: () => t('list.archiveDescription'), description: 'Tutti gli articoli pubblicati sul blog.',
ogType: 'website', ogType: 'website',
}) })
@@ -30,15 +29,15 @@ useHead({ link: [{ rel: 'canonical', href: canonical }] })
<template> <template>
<div> <div>
<header class="page-header"> <header class="page-header">
<p class="kicker">{{ $t('list.archive') }}</p> <p class="kicker">L'archivio</p>
<h1>{{ $t('list.articles') }}</h1> <h1>Articoli</h1>
</header> </header>
<p v-if="error">{{ $t('list.failed') }}</p> <p v-if="error">Non è stato possibile caricare gli articoli. Riprova più tardi.</p>
<p v-else-if="status === 'pending'">{{ $t('list.loading') }}</p> <p v-else-if="status === 'pending'">Caricamento…</p>
<p v-else-if="!data?.items.length">{{ $t('list.empty') }}</p> <p v-else-if="!data?.items.length">Non è stato ancora pubblicato nulla.</p>
<template v-else> <template v-else>
<ul class="card-grid"> <ul class="card-grid">
@@ -47,19 +46,19 @@ useHead({ link: [{ rel: 'canonical', href: canonical }] })
</li> </li>
</ul> </ul>
<nav v-if="data.pageCount > 1" class="pagination" :aria-label="$t('pagination.label')"> <nav v-if="data.pageCount > 1" class="pagination" aria-label="Paginazione">
<NuxtLink v-if="data.page > 1" :to="{ query: { page: data.page - 1 } }" rel="prev"> <NuxtLink v-if="data.page > 1" :to="{ query: { page: data.page - 1 } }" rel="prev">
{{ $t('pagination.previous') }} Pagina precedente
</NuxtLink> </NuxtLink>
<span class="muted"> <span class="muted">
{{ $t('pagination.position', { page: data.page, total: data.pageCount }) }} Pagina {{ data.page }} di {{ data.pageCount }}
</span> </span>
<NuxtLink <NuxtLink
v-if="data.page < data.pageCount" v-if="data.page < data.pageCount"
:to="{ query: { page: data.page + 1 } }" :to="{ query: { page: data.page + 1 } }"
rel="next" rel="next"
> >
{{ $t('pagination.next') }} Pagina successiva
</NuxtLink> </NuxtLink>
</nav> </nav>
</template> </template>
+8 -9
View File
@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ArticleSummary, Paginated, Category } from '#shared/types/blog' import type { ArticleSummary, Paginated, Category } from '#shared/types/blog'
const { t } = useI18n()
const route = useRoute() const route = useRoute()
const slug = route.params.slug as string const slug = route.params.slug as string
@@ -27,7 +26,7 @@ const canonical = computed(
useSeoMeta({ useSeoMeta({
title: category.value.name, title: category.value.name,
description: () => t('list.categoryDescription', { name: category.value?.name ?? '' }), description: () => `Tutti gli articoli nella categoria ${category.value?.name ?? ''}.`,
ogType: 'website', ogType: 'website',
}) })
@@ -37,13 +36,13 @@ useHead({ link: [{ rel: 'canonical', href: canonical }] })
<template> <template>
<div> <div>
<header class="page-header"> <header class="page-header">
<p class="kicker">{{ $t('list.category') }}</p> <p class="kicker">Categoria</p>
<h1>{{ category?.name }}</h1> <h1>{{ category?.name }}</h1>
</header> </header>
<p v-if="error">{{ $t('list.failed') }}</p> <p v-if="error">Non è stato possibile caricare gli articoli. Riprova più tardi.</p>
<p v-else-if="!data?.items.length">{{ $t('list.categoryEmpty') }}</p> <p v-else-if="!data?.items.length">Non ci sono articoli in questa categoria.</p>
<template v-else> <template v-else>
<ul class="card-grid"> <ul class="card-grid">
@@ -52,19 +51,19 @@ useHead({ link: [{ rel: 'canonical', href: canonical }] })
</li> </li>
</ul> </ul>
<nav v-if="data.pageCount > 1" class="pagination" :aria-label="$t('pagination.label')"> <nav v-if="data.pageCount > 1" class="pagination" aria-label="Paginazione">
<NuxtLink v-if="data.page > 1" :to="{ query: { page: data.page - 1 } }" rel="prev"> <NuxtLink v-if="data.page > 1" :to="{ query: { page: data.page - 1 } }" rel="prev">
{{ $t('pagination.previous') }} Pagina precedente
</NuxtLink> </NuxtLink>
<span class="muted"> <span class="muted">
{{ $t('pagination.position', { page: data.page, total: data.pageCount }) }} Pagina {{ data.page }} di {{ data.pageCount }}
</span> </span>
<NuxtLink <NuxtLink
v-if="data.page < data.pageCount" v-if="data.page < data.pageCount"
:to="{ query: { page: data.page + 1 } }" :to="{ query: { page: data.page + 1 } }"
rel="next" rel="next"
> >
{{ $t('pagination.next') }} Pagina successiva
</NuxtLink> </NuxtLink>
</nav> </nav>
</template> </template>
@@ -0,0 +1,132 @@
<script setup lang="ts">
const { public: config } = useRuntimeConfig()
const route = useRoute()
const canonical = computed(() => `${config.siteUrl}${route.path}`)
const title = 'Corsi di formazione sulle criptovalute'
const description = 'Corsi pratici, individuali o di gruppo, per capire come funzionano le criptovalute e difendersi dal corralito.'
useSeoMeta({
title,
description,
ogTitle: title,
ogDescription: description,
ogType: 'website',
ogUrl: canonical,
ogImage: `${config.siteUrl}/protesta-bancaria.jpg`,
})
useHead({ link: [{ rel: 'canonical', href: canonical }] })
</script>
<template>
<article>
<header class="article-header">
<h1>Come difendersi dal corralito</h1>
</header>
<img
class="cover"
src="/protesta-bancaria.jpg"
alt="Manifesti e scritte contro le banche durante una crisi bancaria"
width="770"
height="420"
>
<div class="prose">
<p>
Stai pensando di avvicinarti al mondo delle criptovalute (un mercato parallelo al
mercato tradizionale finanziario), ma non sai da dove cominciare?
</p>
<p>
È possibile organizzare corsi individuali o di gruppo dedicati alla conoscenza e al
funzionamento delle criptovalute, con un approccio prevalentemente pratico e senza
fornire consigli o raccomandazioni finanziarie.
</p>
<p>Durante il corso possiamo affrontare, tra gli altri, questi argomenti:</p>
<ul>
<li>quali sono i principali tipi di criptovalute e quali differenze esistono tra loro;</li>
<li>come funziona una blockchain e cosa significa realmente effettuare una transazione;</li>
<li>dove e come vengono conservate le criptovalute: wallet, exchange e sistemi di custodia;</li>
<li>come acquistare e vendere criptovalute e quali sono le principali modalità disponibili;</li>
<li>come utilizzare un wallet e gestire correttamente le proprie chiavi;</li>
<li>quali sono i principali rischi legati alla sicurezza e alla custodia;</li>
<li>come orientarsi nel vastissimo universo delle criptovalute e dei token.</li>
</ul>
<p>
Non si tratta di consulenza finanziaria e non verranno fornite indicazioni su quali
criptovalute acquistare o vendere. L'obiettivo è fornire conoscenze e strumenti per
comprendere questo nuovo mondo e muoversi al suo interno con maggiore consapevolezza.
</p>
</div>
<div class="contact-cta">
<p class="kicker">Per informazioni sui corsi, modalità e disponibilità</p>
<p class="contact-links">
<a :href="`mailto:${SITE_EMAIL}`">Scrivimi via email</a>
<span aria-hidden="true">·</span>
<a href="https://t.me/Ito1505" target="_blank" rel="noopener">Scrivimi su Telegram</a>
</p>
</div>
</article>
</template>
<style scoped>
.article-header {
max-width: 46rem;
margin: 0 auto 2rem;
text-align: center;
}
@media (min-width: 48rem) {
.article-header {
margin-bottom: 3rem;
}
}
.cover {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
margin-block: 0 3rem;
background: var(--color-surface);
}
.prose {
margin-inline: auto;
}
.contact-cta {
max-width: var(--width-prose);
margin: 3rem auto 0;
padding-top: 2rem;
border-top: 1px solid var(--color-border);
text-align: center;
}
.contact-links {
margin-top: 0.75rem;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.6rem;
font-size: 0.75rem;
font-weight: 600;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.contact-links a {
padding-bottom: 0.35rem;
text-decoration: none;
border-bottom: 1px solid var(--color-ink);
}
.contact-links a:hover {
color: var(--color-ink);
}
</style>
+98 -66
View File
@@ -1,16 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ArticleSummary, Paginated } from '#shared/types/blog' import type { ArticleSummary, Paginated } from '#shared/types/blog'
const { t, locale } = useI18n()
const { data, error } = await useFetch<Paginated<ArticleSummary>>('/api/articles', { const { data, error } = await useFetch<Paginated<ArticleSummary>>('/api/articles', {
key: 'home-articles', key: 'home-articles',
query: { page: 1 }, 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 featured = computed(() => data.value?.items[0] ?? null)
const rest = computed(() => data.value?.items.slice(1, 7) ?? [])
const mediaUrl = useMediaUrl() const mediaUrl = useMediaUrl()
const featuredCover = computed(() => mediaUrl(featured.value?.cover)) const featuredCover = computed(() => mediaUrl(featured.value?.cover))
@@ -24,9 +20,9 @@ useHead({ titleTemplate: '%s', link: [{ rel: 'canonical', href: canonical }] })
useSeoMeta({ useSeoMeta({
title: SITE_NAME, title: SITE_NAME,
description: () => t('site.tagline'), description: 'Articoli, guide e analisi.',
ogTitle: SITE_NAME, ogTitle: SITE_NAME,
ogDescription: () => t('site.tagline'), ogDescription: 'Articoli, guide e analisi.',
ogType: 'website', ogType: 'website',
ogUrl: canonical, ogUrl: canonical,
ogImage: `${config.siteUrl}/logo.png`, ogImage: `${config.siteUrl}/logo.png`,
@@ -35,103 +31,162 @@ useSeoMeta({
<template> <template>
<div> <div>
<p v-if="error">{{ $t('list.failed') }}</p> <section class="landing">
<img
class="landing-image"
src="/protesta-bancaria.jpg"
alt="Manifesti e scritte contro le banche durante una crisi bancaria"
width="770"
height="420"
>
<p v-else-if="!featured">{{ $t('list.empty') }}</p> <h1>La fine dell'Unione Europea per come l'abbiamo conosciuta.</h1>
<img
class="landing-image"
src="/eurozona-crisi.jpg"
alt="Bandiera dell'Unione Europea incrinata"
width="1000"
height="736"
>
<div class="landing-text">
<p>
La fine della nostra moneta come moneta forte: la fine di quella moneta che ci ha
dato la vera libertà di viaggiare, consumare e fare.
</p>
<p>
Una fine che avverrà a seguito di un "incidente" nucleare, al quale farà seguito un
corralito bancario, ossia l'impossibilità, da parte dei cittadini europei, di
disporre liberamente dei propri depositi.
</p>
<p>
Le monete fiduciarie sono per loro natura cannibalizzanti. Oggi tocca all'euro.
Anche perché le altre hanno praticamente perso tutte tutto.
</p>
</div>
</section>
<p v-if="error">Non è stato possibile caricare gli articoli. Riprova più tardi.</p>
<p v-else-if="!featured">Non è stato ancora pubblicato nulla.</p>
<template v-else> <template v-else>
<article class="featured"> <article class="featured" :class="{ 'has-cover': featuredCover }">
<NuxtLinkLocale <NuxtLink
v-if="featuredCover"
class="featured-cover" class="featured-cover"
:to="`/blog/${featured.slug}`" :to="`/blog/${featured.slug}`"
tabindex="-1" tabindex="-1"
aria-hidden="true" aria-hidden="true"
> >
<img <img
v-if="featuredCover"
:src="featuredCover" :src="featuredCover"
:alt="featured.cover?.alternativeText ?? ''" :alt="featured.cover?.alternativeText ?? ''"
:width="featured.cover?.width ?? undefined" :width="featured.cover?.width ?? undefined"
:height="featured.cover?.height ?? undefined" :height="featured.cover?.height ?? undefined"
> >
<span v-else class="placeholder" /> </NuxtLink>
</NuxtLinkLocale>
<div class="featured-text"> <div class="featured-text">
<p class="kicker"> <p class="kicker">
{{ featured.category ? featured.category.name : $t('home.latest') }} {{ featured.category ? featured.category.name : 'Ultimo' }}
</p> </p>
<h1> <h2>
<NuxtLinkLocale :to="`/blog/${featured.slug}`">{{ featured.title }}</NuxtLinkLocale> <NuxtLink :to="`/blog/${featured.slug}`">{{ featured.title }}</NuxtLink>
</h1> </h2>
<p class="kicker date"> <p class="kicker date">
<time :datetime="isoDate(featured.publishedAt)"> <time :datetime="isoDate(featured.publishedAt)">
{{ formatDate(featured.publishedAt, locale) }} {{ formatDate(featured.publishedAt) }}
</time> </time>
</p> </p>
<p class="read-more"> <p class="read-more">
<NuxtLinkLocale :to="`/blog/${featured.slug}`"> <NuxtLink :to="`/blog/${featured.slug}`">
{{ $t('home.readArticle') }} Leggi l'ultimo articolo
</NuxtLinkLocale> </NuxtLink>
</p> </p>
</div> </div>
</article> </article>
<template v-if="rest.length">
<h2 class="section-heading kicker">{{ $t('home.moreStories') }}</h2>
<ul class="card-grid">
<li v-for="article in rest" :key="article.slug">
<ArticleCard :article="article" />
</li>
</ul>
</template>
<p class="more">
<NuxtLinkLocale to="/blog">{{ $t('home.viewAll') }}</NuxtLinkLocale>
</p>
</template> </template>
</div> </div>
</template> </template>
<style scoped> <style scoped>
.landing {
max-width: var(--width-prose);
margin-inline: auto;
margin-bottom: var(--gap-section);
padding-bottom: var(--gap-section);
border-bottom: 1px solid var(--color-border);
text-align: center;
}
.landing-image {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
background: var(--color-surface);
}
.landing h1 {
margin-block: 1.75rem;
font-size: clamp(2rem, 4.5vw, 3.1rem);
}
.landing-text {
margin-top: 1.75rem;
text-align: left;
}
.landing-text p {
margin-top: 1.1rem;
}
.featured { .featured {
display: grid; display: grid;
gap: 2.5rem; gap: 1.5rem;
align-items: center; align-items: center;
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
@media (min-width: 52rem) { /* Stacked on phones and portrait tablets — a side-by-side split below this
.featured { width leaves both the image and the headline too cramped to read. The split
also needs a cover to sit in it, or one column would just be empty. */
@media (min-width: 64rem) {
.featured.has-cover {
grid-template-columns: 1.35fr 1fr; grid-template-columns: 1.35fr 1fr;
gap: 3.5rem; gap: 3.5rem;
} }
} }
/* Without a cover the headline is the whole lead, so it gets the full width
but stays inside a readable measure. */
.featured:not(.has-cover) .featured-text {
max-width: 46rem;
}
.featured-cover { .featured-cover {
display: block; display: block;
overflow: hidden; overflow: hidden;
} }
.featured-cover img, .featured-cover img {
.placeholder {
width: 100%; width: 100%;
aspect-ratio: 3 / 2; aspect-ratio: 3 / 2;
object-fit: cover; object-fit: cover;
background: var(--color-surface); background: var(--color-surface);
} }
.featured h1 { .featured h2 {
margin-top: 0.6rem; margin-top: 0.6rem;
font-size: clamp(2rem, 4.5vw, 3.1rem); font-size: clamp(2rem, 4.5vw, 3.1rem);
} }
.featured h1 a { .featured h2 a {
text-decoration: none; text-decoration: none;
} }
.featured h1 a:hover { .featured h2 a:hover {
text-decoration: underline; text-decoration: underline;
text-underline-offset: 0.12em; text-underline-offset: 0.12em;
} }
@@ -154,27 +209,4 @@ useSeoMeta({
text-decoration: none; text-decoration: none;
border-bottom: 1px solid var(--color-ink); border-bottom: 1px solid var(--color-ink);
} }
.more {
margin-top: 4rem;
text-align: center;
font-size: 0.75rem;
font-weight: 600;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.more 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;
}
.more a:hover {
background: var(--color-ink);
color: var(--color-bg);
}
</style> </style>
-52
View File
@@ -1,52 +0,0 @@
{
"site": {
"tagline": "Articles, guides and analysis.",
"skipToContent": "Skip to content",
"mainNavigation": "Main navigation",
"languageLabel": "Language",
"allArticles": "All articles",
"home": "Home",
"browse": "Browse",
"categories": "Categories",
"contact": "Contact",
"noCategories": "Nothing published yet",
"rights": "All rights reserved.",
"follow": "Follow"
},
"home": {
"latest": "Latest",
"readArticle": "Read the article",
"moreStories": "More stories",
"viewAll": "View all articles"
},
"list": {
"archive": "The archive",
"articles": "Articles",
"articlesPage": "Articles — page {page}",
"archiveDescription": "Every article published on the blog.",
"category": "Category",
"categoryDescription": "Every article in the {name} category.",
"loading": "Loading…",
"empty": "Nothing has been published yet.",
"categoryEmpty": "There are no articles in this category.",
"failed": "Articles could not be loaded. Please try again later."
},
"pagination": {
"label": "Pagination",
"previous": "Previous page",
"next": "Next page",
"position": "Page {page} of {total}"
},
"article": {
"breadcrumb": "Breadcrumb",
"back": "Back to all articles",
"by": "By {name}"
},
"error": {
"notFoundTitle": "Page not found",
"notFoundBody": "The page you are looking for does not exist or has moved.",
"genericTitle": "Something went wrong",
"genericBody": "Please try again in a moment.",
"backHome": "Back to home"
}
}
-52
View File
@@ -1,52 +0,0 @@
{
"site": {
"tagline": "Artículos, guías y análisis.",
"skipToContent": "Ir al contenido",
"mainNavigation": "Navegación principal",
"languageLabel": "Idioma",
"allArticles": "Todos los artículos",
"home": "Inicio",
"browse": "Explorar",
"categories": "Categorías",
"contact": "Contacto",
"noCategories": "Aún no hay publicaciones",
"rights": "Todos los derechos reservados.",
"follow": "Síguenos"
},
"home": {
"latest": "Último",
"readArticle": "Leer el artículo",
"moreStories": "Más artículos",
"viewAll": "Ver todos los artículos"
},
"list": {
"archive": "El archivo",
"articles": "Artículos",
"articlesPage": "Artículos — página {page}",
"archiveDescription": "Todos los artículos publicados en el blog.",
"category": "Categoría",
"categoryDescription": "Todos los artículos de la categoría {name}.",
"loading": "Cargando…",
"empty": "Todavía no se ha publicado nada.",
"categoryEmpty": "No hay artículos en esta categoría.",
"failed": "No se han podido cargar los artículos. Inténtalo de nuevo más tarde."
},
"pagination": {
"label": "Paginación",
"previous": "Página anterior",
"next": "Página siguiente",
"position": "Página {page} de {total}"
},
"article": {
"breadcrumb": "Ruta de navegación",
"back": "Volver a todos los artículos",
"by": "Por {name}"
},
"error": {
"notFoundTitle": "Página no encontrada",
"notFoundBody": "La página que buscas no existe o se ha movido.",
"genericTitle": "Algo ha salido mal",
"genericBody": "Inténtalo de nuevo en unos instantes.",
"backHome": "Volver al inicio"
}
}
-52
View File
@@ -1,52 +0,0 @@
{
"site": {
"tagline": "Articles, guides et analyses.",
"skipToContent": "Aller au contenu",
"mainNavigation": "Navigation principale",
"languageLabel": "Langue",
"allArticles": "Tous les articles",
"home": "Accueil",
"browse": "Parcourir",
"categories": "Catégories",
"contact": "Contact",
"noCategories": "Rien n'a encore été publié",
"rights": "Tous droits réservés.",
"follow": "Suivez-nous"
},
"home": {
"latest": "Dernier",
"readArticle": "Lire l'article",
"moreStories": "Autres articles",
"viewAll": "Voir tous les articles"
},
"list": {
"archive": "Les archives",
"articles": "Articles",
"articlesPage": "Articles — page {page}",
"archiveDescription": "Tous les articles publiés sur le blog.",
"category": "Catégorie",
"categoryDescription": "Tous les articles de la catégorie {name}.",
"loading": "Chargement…",
"empty": "Rien n'a encore été publié.",
"categoryEmpty": "Il n'y a aucun article dans cette catégorie.",
"failed": "Les articles n'ont pas pu être chargés. Veuillez réessayer plus tard."
},
"pagination": {
"label": "Pagination",
"previous": "Page précédente",
"next": "Page suivante",
"position": "Page {page} sur {total}"
},
"article": {
"breadcrumb": "Fil d'Ariane",
"back": "Retour à tous les articles",
"by": "Par {name}"
},
"error": {
"notFoundTitle": "Page introuvable",
"notFoundBody": "La page que vous cherchez n'existe pas ou a été déplacée.",
"genericTitle": "Une erreur est survenue",
"genericBody": "Veuillez réessayer dans un instant.",
"backHome": "Retour à l'accueil"
}
}
-52
View File
@@ -1,52 +0,0 @@
{
"site": {
"tagline": "Articoli, guide e analisi.",
"skipToContent": "Vai al contenuto",
"mainNavigation": "Navigazione principale",
"languageLabel": "Lingua",
"allArticles": "Tutti gli articoli",
"home": "Home",
"browse": "Naviga",
"categories": "Categorie",
"contact": "Contatti",
"noCategories": "Ancora nessuna pubblicazione",
"rights": "Tutti i diritti riservati.",
"follow": "Seguici"
},
"home": {
"latest": "Ultimo",
"readArticle": "Leggi l'articolo",
"moreStories": "Altri articoli",
"viewAll": "Vedi tutti gli articoli"
},
"list": {
"archive": "L'archivio",
"articles": "Articoli",
"articlesPage": "Articoli — pagina {page}",
"archiveDescription": "Tutti gli articoli pubblicati sul blog.",
"category": "Categoria",
"categoryDescription": "Tutti gli articoli nella categoria {name}.",
"loading": "Caricamento…",
"empty": "Non è stato ancora pubblicato nulla.",
"categoryEmpty": "Non ci sono articoli in questa categoria.",
"failed": "Non è stato possibile caricare gli articoli. Riprova più tardi."
},
"pagination": {
"label": "Paginazione",
"previous": "Pagina precedente",
"next": "Pagina successiva",
"position": "Pagina {page} di {total}"
},
"article": {
"breadcrumb": "Percorso di navigazione",
"back": "Torna a tutti gli articoli",
"by": "Di {name}"
},
"error": {
"notFoundTitle": "Pagina non trovata",
"notFoundBody": "La pagina che cerchi non esiste o è stata spostata.",
"genericTitle": "Qualcosa è andato storto",
"genericBody": "Riprova tra qualche istante.",
"backHome": "Torna alla home"
}
}
+1 -23
View File
@@ -5,12 +5,11 @@ export default defineNuxtConfig({
compatibilityDate: '2025-07-15', compatibilityDate: '2025-07-15',
devtools: { enabled: true }, devtools: { enabled: true },
modules: ['@nuxtjs/i18n'],
css: ['~/assets/css/main.css'], css: ['~/assets/css/main.css'],
app: { app: {
head: { head: {
htmlAttrs: { lang: 'it' },
titleTemplate: `%s · ${SITE_NAME}`, titleTemplate: `%s · ${SITE_NAME}`,
meta: [{ name: 'viewport', content: 'width=device-width, initial-scale=1' }], meta: [{ name: 'viewport', content: 'width=device-width, initial-scale=1' }],
link: [ link: [
@@ -20,27 +19,6 @@ export default defineNuxtConfig({
}, },
}, },
i18n: {
// English keeps the bare URLs; the others are prefixed (/it/blog, /es/blog…).
defaultLocale: 'en',
strategy: 'prefix_except_default',
locales: [
{ code: 'en', language: 'en-GB', name: 'English', file: 'en.json' },
{ code: 'it', language: 'it-IT', name: 'Italiano', file: 'it.json' },
{ code: 'es', language: 'es-ES', name: 'Español', file: 'es.json' },
{ code: 'fr', language: 'fr-FR', name: 'Français', file: 'fr.json' },
],
// First visit follows the browser language; after that the cookie wins.
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'locale',
redirectOn: 'root',
},
// Overridden per environment with NUXT_PUBLIC_I18N_BASE_URL, so the
// alternate-language links are absolute and correct in production.
baseUrl: 'http://localhost:3000',
},
runtimeConfig: { runtimeConfig: {
// Server-only: internal Strapi address, never exposed to the browser. // Server-only: internal Strapi address, never exposed to the browser.
strapiUrl: 'http://localhost:1337', strapiUrl: 'http://localhost:1337',
+1 -2766
View File
File diff suppressed because it is too large. Load diff
-1
View File
@@ -11,7 +11,6 @@
"typecheck": "nuxt typecheck" "typecheck": "nuxt typecheck"
}, },
"dependencies": { "dependencies": {
"@nuxtjs/i18n": "^10.6.0",
"marked": "^18.0.11", "marked": "^18.0.11",
"nuxt": "^4.5.2", "nuxt": "^4.5.2",
"simple-icons": "^16.28.0", "simple-icons": "^16.28.0",
Binary file not shown.

After

Width:  |  Height:  |  Size: 404 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

+4 -4
View File
@@ -1,13 +1,13 @@
/** Human-readable date for display; returns an empty string when unset. */ /** Human-readable date for display; returns an empty string when unset. */
export function formatDate(value: string | null | undefined, locale = 'en-GB'): string { export function formatDate(value: string | null | undefined): string {
if (!value) return '' if (!value) return ''
return new Intl.DateTimeFormat(locale, { dateStyle: 'long' }).format(new Date(value)) return new Intl.DateTimeFormat('it-IT', { dateStyle: 'long' }).format(new Date(value))
} }
/** Date and time of publication, shown in the article byline. */ /** Date and time of publication, shown in the article byline. */
export function formatDateTime(value: string | null | undefined, locale = 'en-GB'): string { export function formatDateTime(value: string | null | undefined): string {
if (!value) return '' if (!value) return ''
return new Intl.DateTimeFormat(locale, { dateStyle: 'long', timeStyle: 'short' }) return new Intl.DateTimeFormat('it-IT', { dateStyle: 'long', timeStyle: 'short' })
.format(new Date(value)) .format(new Date(value))
} }