feat: Implement dynamic node title metadata and enhance swarm user and post hydration.
This commit is contained in:
+28
-10
@@ -13,16 +13,34 @@ const sairaCondensed = Saira_Condensed({
|
||||
variable: "--font-saira",
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Synapsis",
|
||||
description: "Synapsis is designed to function like a global signal layer rather than a culture-bound platform. Anyone can run their own node and still participate in a shared, interconnected network, with global identity, clean terminology, and a modern interface that feels current rather than experimental.",
|
||||
manifest: "/manifest.json",
|
||||
icons: {
|
||||
icon: "/api/favicon",
|
||||
},
|
||||
themeColor: "#0a0a0a",
|
||||
viewport: "width=device-width, initial-scale=1, maximum-scale=1",
|
||||
};
|
||||
import { db } from "@/db";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
let title = "Synapsis";
|
||||
|
||||
try {
|
||||
const node = await db.query.nodes.findFirst();
|
||||
if (node?.name) {
|
||||
title = node.name;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Failed to fetch node info for metadata", e);
|
||||
}
|
||||
|
||||
return {
|
||||
title: {
|
||||
default: title,
|
||||
template: `%s | ${title}`,
|
||||
},
|
||||
description: "Synapsis is designed to function like a global signal layer rather than a culture-bound platform. Anyone can run their own node and still participate in a shared, interconnected network, with global identity, clean terminology, and a modern interface that feels current rather than experimental.",
|
||||
manifest: "/manifest.json",
|
||||
icons: {
|
||||
icon: "/api/favicon",
|
||||
},
|
||||
themeColor: "#0a0a0a",
|
||||
viewport: "width=device-width, initial-scale=1, maximum-scale=1",
|
||||
};
|
||||
}
|
||||
|
||||
// Force all routes to be dynamic (no static generation at build time)
|
||||
// This is appropriate for a social network where all content is user-generated
|
||||
|
||||
Reference in New Issue
Block a user