mirror of
https://github.com/XFox111/my-website.git
synced 2026-04-22 07:28:01 +03:00
fix: DOMAIN_NAME variable partially baked in on build time
This commit is contained in:
+35
-31
@@ -1,7 +1,8 @@
|
||||
import Package from "@/../package.json";
|
||||
import { Metadata } from "next";
|
||||
import { unstable_noStore } from "next/cache";
|
||||
import bio from "./bio";
|
||||
import socials from "./socials";
|
||||
import Package from "@/../package.json";
|
||||
|
||||
export const canonicalName: URL = new URL(`https://${process.env.DOMAIN_NAME}`);
|
||||
const baseTitle: string = "Eugene Fox - Software developer";
|
||||
@@ -12,37 +13,40 @@ const keywords: string[] = ["Eugene Fox", "software developer", ".net", "react",
|
||||
export const getTitle = (pageTitle: string, customBase?: string): string =>
|
||||
pageTitle + " - " + (customBase ?? baseTitle);
|
||||
|
||||
export const metadata: Metadata =
|
||||
export async function generateMetadata(): Promise<Metadata>
|
||||
{
|
||||
title: baseTitle,
|
||||
description: bio[0],
|
||||
metadataBase: canonicalName,
|
||||
openGraph:
|
||||
{
|
||||
unstable_noStore();
|
||||
return {
|
||||
title: baseTitle,
|
||||
description: bio[0],
|
||||
type: "profile",
|
||||
firstName: Package.author.name.split(" ")[0],
|
||||
lastName: Package.author.name.split(" ")[1],
|
||||
gender,
|
||||
username: socials["Twitter"].username,
|
||||
siteName: canonicalName.hostname,
|
||||
locale: "en_US"
|
||||
},
|
||||
twitter:
|
||||
{
|
||||
site: socials["Twitter"].username,
|
||||
card: "summary_large_image"
|
||||
},
|
||||
alternates:
|
||||
{
|
||||
canonical: canonicalName.href
|
||||
},
|
||||
authors: [
|
||||
metadataBase: canonicalName,
|
||||
openGraph:
|
||||
{
|
||||
name: Package.author.name,
|
||||
url: socials["LinkedIn"].href
|
||||
}
|
||||
],
|
||||
keywords
|
||||
};
|
||||
title: baseTitle,
|
||||
description: bio[0],
|
||||
type: "profile",
|
||||
firstName: Package.author.name.split(" ")[0],
|
||||
lastName: Package.author.name.split(" ")[1],
|
||||
gender,
|
||||
username: socials["Twitter"].username,
|
||||
siteName: canonicalName.hostname,
|
||||
locale: "en_US"
|
||||
},
|
||||
twitter:
|
||||
{
|
||||
site: socials["Twitter"].username,
|
||||
card: "summary_large_image"
|
||||
},
|
||||
alternates:
|
||||
{
|
||||
canonical: canonicalName.href
|
||||
},
|
||||
authors: [
|
||||
{
|
||||
name: Package.author.name,
|
||||
url: socials["LinkedIn"].href
|
||||
}
|
||||
],
|
||||
keywords
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,14 +6,18 @@ import ThirdPartyAttribution from "@/_data/ThirdPartyAttributiont";
|
||||
import { analyticsEnabled } from "@/_utils/analytics/server";
|
||||
import { ArrowLeft24Regular, ArrowRight24Regular } from "@fluentui/react-icons";
|
||||
import { Metadata } from "next";
|
||||
import { unstable_noStore } from "next/cache";
|
||||
import React from "react";
|
||||
import cls from "./page.module.scss";
|
||||
|
||||
export const metadata: Metadata =
|
||||
export async function generateMetadata(): Promise<Metadata>
|
||||
{
|
||||
title: getTitle("Attributions & information", canonicalName.hostname),
|
||||
robots: "noindex"
|
||||
};
|
||||
unstable_noStore();
|
||||
return {
|
||||
title: getTitle("Attributions & information", canonicalName.hostname),
|
||||
robots: "noindex"
|
||||
};
|
||||
}
|
||||
|
||||
const AttributionPage: React.FC = () => (
|
||||
<main className={ cls.page }>
|
||||
|
||||
+2
-4
@@ -1,5 +1,5 @@
|
||||
import { metadata as myMetadata } from "@/_data/metadata";
|
||||
import type { Metadata, Viewport } from "next";
|
||||
export { generateMetadata } from "@/_data/metadata";
|
||||
import type { Viewport } from "next";
|
||||
import Script from "next/script";
|
||||
import { PropsWithChildren } from "react";
|
||||
import CookieBanner from "./_components/CookieBanner";
|
||||
@@ -19,8 +19,6 @@ export const viewport: Viewport =
|
||||
colorScheme: "light dark"
|
||||
};
|
||||
|
||||
export const metadata: Metadata = myMetadata;
|
||||
|
||||
export default function RootLayout(props: PropsWithChildren)
|
||||
{
|
||||
return (
|
||||
|
||||
+8
-4
@@ -1,6 +1,7 @@
|
||||
import { textCorrection } from "@/_assets/decorations";
|
||||
import { Home24Regular } from "@fluentui/react-icons";
|
||||
import { Metadata } from "next";
|
||||
import { unstable_noStore } from "next/cache";
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
import { notFoundImage } from "./_assets/illustrations";
|
||||
@@ -8,11 +9,14 @@ import Button from "./_components/Button";
|
||||
import { canonicalName, getTitle } from "./_data/metadata";
|
||||
import cls from "./not-found.module.scss";
|
||||
|
||||
export const metadata: Metadata =
|
||||
export async function generateMetadata(): Promise<Metadata>
|
||||
{
|
||||
title: getTitle("Page not found", canonicalName.hostname),
|
||||
robots: "noindex"
|
||||
};
|
||||
unstable_noStore();
|
||||
return {
|
||||
title: getTitle("Page not found", canonicalName.hostname),
|
||||
robots: "noindex"
|
||||
};
|
||||
}
|
||||
|
||||
// [SPECIAL]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user