Commit eea7fd1e by PLN (Algolia)

layout: drop the tutorial leftovers — Go Back div, Vercel utm footer; footer PLN…

layout: drop the tutorial leftovers — Go Back div, Vercel utm footer; footer PLN links home, banner says what's on screen
Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
parent 503df710
...@@ -20,13 +20,15 @@ export function buildLanguageNav(post) { ...@@ -20,13 +20,15 @@ export function buildLanguageNav(post) {
if (post.untranslated === 'fr') { if (post.untranslated === 'fr') {
nav.banner = { nav.banner = {
text: "Cet article n'existe pas (encore) en français.", // The requested language is missing, so what's on screen IS the other
// language — say so instead of promising a click that changes nothing.
text: "Cet article n'existe pas (encore) en français — voici la version anglaise.",
href: `${base}/en`, href: `${base}/en`,
label: 'Lire la version anglaise', label: 'Lire la version anglaise',
}; };
} else if (post.untranslated === 'en') { } else if (post.untranslated === 'en') {
nav.banner = { nav.banner = {
text: "This post doesn't exist in English (yet).", text: "This post doesn't exist in English (yet) — here's the French version.",
href: base, href: base,
label: 'Read the French version', label: 'Read the French version',
}; };
......
...@@ -4,7 +4,6 @@ import Image from "next/image"; ...@@ -4,7 +4,6 @@ import Image from "next/image";
import styles from "./layout.module.css"; import styles from "./layout.module.css";
import utilStyles from "../styles/utils.module.css"; import utilStyles from "../styles/utils.module.css";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/navigation";
const name = "PLN"; const name = "PLN";
export const siteTitle = "PLN's Works"; export const siteTitle = "PLN's Works";
...@@ -13,7 +12,6 @@ export const twitterHandle = "@PaulLouisNech"; ...@@ -13,7 +12,6 @@ export const twitterHandle = "@PaulLouisNech";
export const description = "PLN's Selected Works"; export const description = "PLN's Selected Works";
export default function Layout({ children, home }) { export default function Layout({ children, home }) {
const router = useRouter();
return ( return (
<div className={`site-shell ${styles.container}`}> <div className={`site-shell ${styles.container}`}>
<header className={styles.header}> <header className={styles.header}>
...@@ -50,22 +48,11 @@ export default function Layout({ children, home }) { ...@@ -50,22 +48,11 @@ export default function Layout({ children, home }) {
)} )}
</header> </header>
<main>{children}</main> <main>{children}</main>
{!home && ( <footer className={styles.footer}>
<div className={styles.backToHome}> <Link href="/" className={styles.footerName}>
<div onClick={() => router.back()} className={utilStyles.backButton}> {name}
Go Back </Link>{' '}
</div> {new Date().getFullYear()} | ☇
</div>
)}
<footer>
PLN {new Date().getFullYear()} | ☇
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
▲
</a>
</footer> </footer>
</div> </div>
); );
......
...@@ -10,6 +10,17 @@ ...@@ -10,6 +10,17 @@
align-items: center; align-items: center;
} }
.backToHome { .footer {
margin: 3rem 0 0; margin-top: 3rem;
font-size: 0.85rem;
color: var(--text-muted);
}
.footerName {
color: var(--text-primary);
text-decoration: none;
}
.footerName:hover {
text-decoration: underline;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment