diff --git a/.env.example b/.env.example
index a373e60e..5abce006 100644
--- a/.env.example
+++ b/.env.example
@@ -10,6 +10,9 @@
# should be updated accordingly.
BACKEND_URL=http://localhost:3000
+# Public origin of the site, for absolute URLs in metadata and the sitemap (default: https://polinetwork.org).
+# Read at build time too: static pages, robots.txt and the sitemap keep the value the build had.
+# SITE_URL=https://polinetwork.org
# PoliNetwork IdP: required, the backend refuses calls without a token. IDP_INTERNAL_URL is optional.
IDP_PUBLIC_URL=https://auth.polinetwork.org
diff --git a/Dockerfile b/Dockerfile
index 31a4452e..7c89fee1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,10 @@ COPY . .
# Uncomment the following line in case you want to disable telemetry during the build.
# ENV NEXT_TELEMETRY_DISABLED=1
ENV SKIP_ENV_VALIDATION=true
+# Public origin for absolute URLs in metadata, robots.txt and the sitemap. The static pages are generated here, so it
+# is read at build time; empty falls back to https://polinetwork.org.
+ARG SITE_URL
+ENV SITE_URL=${SITE_URL}
RUN corepack enable pnpm && pnpm run build
@@ -29,6 +33,9 @@ FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
+# The pages rendered per request read it at runtime: keep it the same as at build time
+ARG SITE_URL
+ENV SITE_URL=${SITE_URL}
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED=1
diff --git a/public/icons/architettura.png b/public/icons/architettura.png
index 4d2b6e1c..ca5dc0cd 100644
Binary files a/public/icons/architettura.png and b/public/icons/architettura.png differ
diff --git a/public/icons/civile.png b/public/icons/civile.png
index 8405e5a3..e7cc717f 100644
Binary files a/public/icons/civile.png and b/public/icons/civile.png differ
diff --git a/public/icons/design.png b/public/icons/design.png
index 8b05faba..70e4c9b1 100644
Binary files a/public/icons/design.png and b/public/icons/design.png differ
diff --git a/public/icons/ingegneria.png b/public/icons/ingegneria.png
index aa0871e6..682d0f33 100644
Binary files a/public/icons/ingegneria.png and b/public/icons/ingegneria.png differ
diff --git a/src/app/groups/page.tsx b/src/app/groups/page.tsx
index b395c918..5b25d853 100644
--- a/src/app/groups/page.tsx
+++ b/src/app/groups/page.tsx
@@ -31,7 +31,7 @@ export default function Home() {
- Groups
+ Gruppi
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index bb4f4bbe..2a940ae5 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -6,6 +6,7 @@ import { ThemeProvider } from "@/components/theme-provider"
import "@/styles/globals.css"
import type { Metadata } from "next"
import { DM_Sans, Poppins, Red_Hat_Text } from "next/font/google"
+import { SITE_URL } from "@/lib/site"
const poppinsFont400 = Poppins({
variable: "--font-poppins",
@@ -23,36 +24,38 @@ const redHatTextFont = Red_Hat_Text({
subsets: ["latin"],
})
-const desc = "The online community of Politecnico di Milano brought to you by its students"
+const desc = "La community online del Politecnico di Milano, gestita dagli studenti per gli studenti"
export const metadata: Metadata = {
+ // Resolves the relative image URLs: without it Next.js falls back to http://localhost:3000
+ metadataBase: SITE_URL,
title: {
default: "PoliNetwork APS",
template: "%s | PoliNetwork APS",
},
description: desc,
icons: [{ rel: "icon", url: "/favicon.ico" }],
+ // No fixed `url`: pages inherit this object, and a single URL would point every page's preview at the homepage
openGraph: {
- url: "https://polinetwork.org/",
siteName: "PoliNetwork",
+ locale: "it_IT",
images: [
{
url: "/polinetwork_meta.png",
width: 200,
height: 200,
- alt: desc,
+ alt: "Logo di PoliNetwork",
},
],
type: "website",
},
+ // Title and description come from the Open Graph tags of each page; the image is a square logo, not a banner
twitter: {
- card: "summary_large_image",
- title: "PoliNetwork/polinetwork.org",
- description: desc,
+ card: "summary",
images: [
{
url: "/polinetwork_meta.png",
- alt: desc,
+ alt: "Logo di PoliNetwork",
},
],
site: "@PoliNetworkAPS",
diff --git a/src/app/matricole/guida/page.tsx b/src/app/matricole/guida/page.tsx
index c959f7a6..d11ff609 100644
--- a/src/app/matricole/guida/page.tsx
+++ b/src/app/matricole/guida/page.tsx
@@ -1,5 +1,6 @@
import type { Metadata } from "next"
-import { FiDownload } from "react-icons/fi"
+import Link from "next/link"
+import { FiArrowLeft, FiDownload } from "react-icons/fi"
import { CardSplit } from "@/components/card-split"
import { CONTAINER } from "@/components/layout/page"
import { Button } from "@/components/ui/button"
@@ -27,6 +28,13 @@ export default async function GuidaMatricolaPage() {
// Standalone page (no header or footer, see `HIDDEN_ROUTES`): the content stays centered on screen, with the
// shared gutters. The vertical padding keeps it off the edges on short landscape screens.
+ {/* Without header and footer, this is the only way back into the site */}
+
+ Matricole
+
{/* Not Hero: this page has no header, and Hero's spacing would push the download below the fold on phones */}