feat: sitemap and favicons

This commit is contained in:
Bereket Engida
2024-09-03 00:34:09 +03:00
parent 1550644009
commit 5da42aa7e8
11 changed files with 80 additions and 3 deletions

View File

@@ -3,12 +3,10 @@ import type { Metadata } from "next";
import {
DocsPage,
DocsBody,
DocsDescription,
DocsTitle,
} from "fumadocs-ui/page";
import { notFound } from "next/navigation";
import { InlineTOC } from "fumadocs-ui/components/inline-toc";
import PromoCard from "@/components/promo-card";
export default async function Page({
params,

View File

@@ -6,10 +6,49 @@ import type { ReactNode } from "react";
import { NavbarProvider } from "@/components/nav-mobile";
import { GeistMono } from "geist/font/mono";
import { GeistSans } from "geist/font/sans";
import { ENV } from "@/lib/constants";
import { Metadata } from "next";
const inter = Inter({
subsets: ["latin"],
});
export const metadata: Metadata = {
metadataBase: new URL(ENV.NEXT_PUBLIC_WEBSITE_URL),
title: {
default: "Better-Auth.",
template: "%s ~ Better Auth",
},
description: "Dev agnostic auth library solution",
openGraph: {
title: "Better-auth",
description: "Dev agnostic auth library solution",
url: ENV.NEXT_PUBLIC_WEBSITE_URL,
siteName: "Better-auth",
locale: "en_US",
type: "website",
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
},
},
twitter: {
title: "Better-auth",
card: "summary_large_image",
},
verification: {
google: ENV.NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION,
},
};
export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>

15
docs/app/sitemap.ts Normal file
View File

@@ -0,0 +1,15 @@
import type { MetadataRoute } from "next";
import { ENV } from "@/lib/constants";
import { getPages } from "./source";
export default function sitemap(): MetadataRoute.Sitemap {
const WEBSITE_URL = ENV.NEXT_PUBLIC_WEBSITE_URL;
const pages = getPages().map((page) => ({
slug: page.slugs,
}));
const docs = pages.map((plugin) => ({
url: `${WEBSITE_URL}/docs/${plugin.slug.join("/")}`,
lastModified: new Date().toISOString().split("T")[0],
}));
return [...docs];
}

6
docs/lib/constants.ts Normal file
View File

@@ -0,0 +1,6 @@
export const ENV = {
NEXT_PUBLIC_WEBSITE_URL:
process.env.NEXT_PUBLIC_WEBSITE_URL || "http://localhost:3000",
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION: "",
NODE_ENV: process.env.NODE_ENV || "development",
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}