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:
@@ -1,7 +1,8 @@
|
|||||||
|
import Package from "@/../package.json";
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
|
import { unstable_noStore } from "next/cache";
|
||||||
import bio from "./bio";
|
import bio from "./bio";
|
||||||
import socials from "./socials";
|
import socials from "./socials";
|
||||||
import Package from "@/../package.json";
|
|
||||||
|
|
||||||
export const canonicalName: URL = new URL(`https://${process.env.DOMAIN_NAME}`);
|
export const canonicalName: URL = new URL(`https://${process.env.DOMAIN_NAME}`);
|
||||||
const baseTitle: string = "Eugene Fox - Software developer";
|
const baseTitle: string = "Eugene Fox - Software developer";
|
||||||
@@ -12,8 +13,10 @@ const keywords: string[] = ["Eugene Fox", "software developer", ".net", "react",
|
|||||||
export const getTitle = (pageTitle: string, customBase?: string): string =>
|
export const getTitle = (pageTitle: string, customBase?: string): string =>
|
||||||
pageTitle + " - " + (customBase ?? baseTitle);
|
pageTitle + " - " + (customBase ?? baseTitle);
|
||||||
|
|
||||||
export const metadata: Metadata =
|
export async function generateMetadata(): Promise<Metadata>
|
||||||
{
|
{
|
||||||
|
unstable_noStore();
|
||||||
|
return {
|
||||||
title: baseTitle,
|
title: baseTitle,
|
||||||
description: bio[0],
|
description: bio[0],
|
||||||
metadataBase: canonicalName,
|
metadataBase: canonicalName,
|
||||||
@@ -45,4 +48,5 @@ export const metadata: Metadata =
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
keywords
|
keywords
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,14 +6,18 @@ import ThirdPartyAttribution from "@/_data/ThirdPartyAttributiont";
|
|||||||
import { analyticsEnabled } from "@/_utils/analytics/server";
|
import { analyticsEnabled } from "@/_utils/analytics/server";
|
||||||
import { ArrowLeft24Regular, ArrowRight24Regular } from "@fluentui/react-icons";
|
import { ArrowLeft24Regular, ArrowRight24Regular } from "@fluentui/react-icons";
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
|
import { unstable_noStore } from "next/cache";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import cls from "./page.module.scss";
|
import cls from "./page.module.scss";
|
||||||
|
|
||||||
export const metadata: Metadata =
|
export async function generateMetadata(): Promise<Metadata>
|
||||||
{
|
{
|
||||||
|
unstable_noStore();
|
||||||
|
return {
|
||||||
title: getTitle("Attributions & information", canonicalName.hostname),
|
title: getTitle("Attributions & information", canonicalName.hostname),
|
||||||
robots: "noindex"
|
robots: "noindex"
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const AttributionPage: React.FC = () => (
|
const AttributionPage: React.FC = () => (
|
||||||
<main className={ cls.page }>
|
<main className={ cls.page }>
|
||||||
|
|||||||
+2
-4
@@ -1,5 +1,5 @@
|
|||||||
import { metadata as myMetadata } from "@/_data/metadata";
|
export { generateMetadata } from "@/_data/metadata";
|
||||||
import type { Metadata, Viewport } from "next";
|
import type { Viewport } from "next";
|
||||||
import Script from "next/script";
|
import Script from "next/script";
|
||||||
import { PropsWithChildren } from "react";
|
import { PropsWithChildren } from "react";
|
||||||
import CookieBanner from "./_components/CookieBanner";
|
import CookieBanner from "./_components/CookieBanner";
|
||||||
@@ -19,8 +19,6 @@ export const viewport: Viewport =
|
|||||||
colorScheme: "light dark"
|
colorScheme: "light dark"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const metadata: Metadata = myMetadata;
|
|
||||||
|
|
||||||
export default function RootLayout(props: PropsWithChildren)
|
export default function RootLayout(props: PropsWithChildren)
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
|
|||||||
+6
-2
@@ -1,6 +1,7 @@
|
|||||||
import { textCorrection } from "@/_assets/decorations";
|
import { textCorrection } from "@/_assets/decorations";
|
||||||
import { Home24Regular } from "@fluentui/react-icons";
|
import { Home24Regular } from "@fluentui/react-icons";
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
|
import { unstable_noStore } from "next/cache";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { notFoundImage } from "./_assets/illustrations";
|
import { notFoundImage } from "./_assets/illustrations";
|
||||||
@@ -8,11 +9,14 @@ import Button from "./_components/Button";
|
|||||||
import { canonicalName, getTitle } from "./_data/metadata";
|
import { canonicalName, getTitle } from "./_data/metadata";
|
||||||
import cls from "./not-found.module.scss";
|
import cls from "./not-found.module.scss";
|
||||||
|
|
||||||
export const metadata: Metadata =
|
export async function generateMetadata(): Promise<Metadata>
|
||||||
{
|
{
|
||||||
|
unstable_noStore();
|
||||||
|
return {
|
||||||
title: getTitle("Page not found", canonicalName.hostname),
|
title: getTitle("Page not found", canonicalName.hostname),
|
||||||
robots: "noindex"
|
robots: "noindex"
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// [SPECIAL]
|
// [SPECIAL]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user