Skip to content

Commit

Permalink
meta tags improved and deps updated
Browse files Browse the repository at this point in the history
  • Loading branch information
CA-MKSingh committed Oct 27, 2024
1 parent a58a835 commit 3ca397f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Deploy static content to Pages

on:
push:
branches: ["trunk"]
release:
types: [published]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand Down
32 changes: 31 additions & 1 deletion app/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { notFound } from "next/navigation";
import defaultMdxComponents from "fumadocs-ui/mdx";
import { getGithubLastEdit } from "fumadocs-core/server";
import { Metadata } from "next";

export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
Expand Down Expand Up @@ -54,13 +55,42 @@ export async function generateStaticParams() {

export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>;
}) {
}): Promise<Metadata> {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

return {
title: page.data.title,
description: page.data.description,
openGraph: {
title: page.data.title,
description: page.data.description,
images: [
{
url: "/img/shield-social-card.png",
width: 1200,
height: 630,
alt: "Shield",
},
],
siteName: "Shield Docs",
locale: "en_US",
},
twitter: {
card: "summary_large_image",
site: "@shield_auth",
title: page.data.title,
description: page.data.description,
creator: "@MKSingh_Dev",
images: [
{
url: "/img/shield-social-card.png",
width: 1200,
height: 630,
alt: "Shield",
},
],
},
};
}
1 change: 0 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { HomeLayout } from "fumadocs-ui/layouts/home";
import "./global.css";
import { RootProvider } from "fumadocs-ui/provider";
import { Inter } from "next/font/google";
Expand Down
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions components/logo.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Image from "next/image";

const Logo = (): React.ReactNode => (
<div className="w-full flex gap-4">
<div className="w-full py-1 flex gap-4 justify-center">
<div className="relative h-16 w-40 flex items-center justify-center">
<Image src="/logo.svg" alt="shield logo" fill />
</div>
<pre>Docs</pre>
<pre className="pt-2">Docs</pre>
</div>
);

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
},
"dependencies": {
"fumadocs-core": "14.0.2",
"fumadocs-mdx": "11.0.0",
"fumadocs-mdx": "11.1.0",
"fumadocs-ui": "14.0.2",
"lucide-react": "^0.453.0",
"next": "15.0.0",
"next": "15.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "22.7.8",
"@types/react": "^18.3.11",
"@types/node": "22.8.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"typescript": "^5.6.3",
"@types/mdx": "^2.0.13",
Expand Down

0 comments on commit 3ca397f

Please sign in to comment.