The home page no longer sends logged-in users to their chart: they see it with the app's header, the buttons lead to their chart, and the login hints and "without login" texts are left out. The login (and setting a password) now lands on /keplet by default, which still goes on to the profile when there is no chart yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
77 lines
2.7 KiB
TypeScript
77 lines
2.7 KiB
TypeScript
import type { Metadata } from "next";
|
||
|
||
import { JsonLd } from "@/components/PublicFooter";
|
||
import { OPERATOR } from "@/lib/legal";
|
||
import { BACKEND_URL, getMe } from "@/lib/server";
|
||
import { siteUrl } from "@/lib/share";
|
||
import type { PublicConfig } from "@/lib/types";
|
||
|
||
import { Landing } from "./Landing";
|
||
|
||
/** Bumped when the preview image changes, so Facebook and co. fetch it again. */
|
||
const PREVIEW_VERSION = 1;
|
||
|
||
export async function generateMetadata(): Promise<Metadata> {
|
||
const base = await siteUrl();
|
||
const title = "Sorsfonalak – ahol a csillagok összekötnek";
|
||
const description =
|
||
"Születési képlet, részletes elemzés, éves előrejelzés és kapcsolati összevetés a legfejlettebb AI-modellekkel, töredék áron.";
|
||
const image = {
|
||
url: `${base}/kep/fooldal.png?v=${PREVIEW_VERSION}`,
|
||
width: 1200,
|
||
height: 630,
|
||
alt: "Egy példa születési képlet a Sorsfonalakon",
|
||
};
|
||
return {
|
||
title: { absolute: "Sorsfonalak – születési képlet, éves előrejelzés, kapcsolati összevetés" },
|
||
description:
|
||
"Percre pontos születési képlet és személyre szóló elemzés a legfejlettebb AI-modellekkel, percek alatt és töredék áron. Éves előrejelzés, kapcsolati összevetés és kártyajóslás.",
|
||
alternates: { canonical: `${base}/` },
|
||
openGraph: { type: "website", siteName: "Sorsfonalak", locale: "hu_HU", url: `${base}/`, title, description, images: [image] },
|
||
twitter: { card: "summary_large_image", title, description, images: [image.url] },
|
||
};
|
||
}
|
||
|
||
async function signupMode(): Promise<PublicConfig["signup_mode"]> {
|
||
try {
|
||
const res = await fetch(`${BACKEND_URL}/v1/config`, { next: { revalidate: 300 } });
|
||
return res.ok ? ((await res.json()) as PublicConfig).signup_mode : "invite";
|
||
} catch {
|
||
return "invite";
|
||
}
|
||
}
|
||
|
||
/** The home page, for visitors and logged-in users alike (they get the app's header and a link to their chart). */
|
||
export default async function Home() {
|
||
const me = await getMe();
|
||
const base = await siteUrl();
|
||
return (
|
||
<>
|
||
<Landing inviteOnly={(await signupMode()) !== "open"} loggedIn={me !== null} />
|
||
<JsonLd
|
||
data={{
|
||
"@context": "https://schema.org",
|
||
"@graph": [
|
||
{
|
||
"@type": "Organization",
|
||
"@id": `${base}/#organization`,
|
||
name: "Sorsfonalak",
|
||
url: `${base}/`,
|
||
logo: `${base}/apple-icon.png`,
|
||
email: OPERATOR.email,
|
||
},
|
||
{
|
||
"@type": "WebSite",
|
||
"@id": `${base}/#website`,
|
||
name: "Sorsfonalak",
|
||
url: `${base}/`,
|
||
inLanguage: "hu",
|
||
publisher: { "@id": `${base}/#organization` },
|
||
},
|
||
],
|
||
}}
|
||
/>
|
||
</>
|
||
);
|
||
}
|