-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(saas): Improved SEO, Metadata to pages
- Loading branch information
1 parent
676e55e
commit 787142c
Showing
35 changed files
with
306 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
starterkits/saas/src/app/(web)/blog/_constants/page-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const blogPageConfig = { | ||
title: "Blog", | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
starterkits/saas/src/app/(web)/changelog/_constants/page-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const changelogPageConfig = { | ||
title: "Change Log", | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
starterkits/saas/src/app/(web)/pricing/_constants/page-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const pricingPageConfig = { | ||
title: "Pricing", | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
starterkits/saas/src/app/(web)/support/_constants/page-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { siteConfig } from "@/config/site"; | ||
|
||
export const supportPageConfig = { | ||
title: "Support", | ||
description: `Get support from ${siteConfig.name} to get started building your next project.`, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
starterkits/saas/src/app/auth/login/_constants/page-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { siteConfig } from "@/config/site"; | ||
|
||
export const loginPageConfig = { | ||
title: "Login", | ||
description: `Login to ${siteConfig.name} to get started building your next project.`, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
starterkits/saas/src/app/auth/signup/_constants/page-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { siteConfig } from "@/config/site"; | ||
|
||
export const signupPageConfig = { | ||
title: "Signup", | ||
description: `Signup to ${siteConfig.name} to get started building your next project.`, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
starterkits/saas/src/app/invite/org/[orgId]/_constants/page-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const invitePageConfig = { | ||
title: ({ orgName }: { orgName: string }) => `Invite to ${orgName}`, | ||
description: ({ orgName }: { orgName: string }) => | ||
`Invite your team to ${orgName} and get started building your next project.`, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
starterkits/saas/src/app/maintenance/_constants/page-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const maintenancePageConfig = { | ||
title: "Maintenance", | ||
description: | ||
"We're currently undergoing maintenance. Please check back later.", | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { siteConfig } from "@/config/site"; | ||
import { siteUrls } from "@/config/urls"; | ||
import type { Metadata } from "next"; | ||
|
||
export const defaultMetadata: Metadata = { | ||
title: { | ||
template: `%s | ${siteConfig.name}`, | ||
default: siteConfig.name, | ||
}, | ||
description: siteConfig.description, | ||
metadataBase: new URL(siteUrls.publicUrl), | ||
keywords: [ | ||
"Next.js", | ||
"React", | ||
"Next.js Starter kit", | ||
"SaaS Starter Kit", | ||
"Shadcn UI", | ||
], | ||
authors: [{ name: "Ali Farooq", url: "https://twitter.com/alifarooqdev" }], | ||
creator: "AliFarooqDev", | ||
}; | ||
|
||
export const twitterMetadata: Metadata["twitter"] = { | ||
title: siteConfig.name, | ||
description: siteConfig.description, | ||
card: "summary_large_image", | ||
images: [siteConfig.orgImage], | ||
creator: "@alifarooqdev", | ||
}; | ||
|
||
export const ogMetadata: Metadata["openGraph"] = { | ||
title: siteConfig.name, | ||
description: siteConfig.description, | ||
type: "website", | ||
images: [{ url: siteConfig.orgImage, alt: siteConfig.name }], | ||
locale: "en_US", | ||
url: siteUrls.publicUrl, | ||
siteName: siteConfig.name, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { publicRoutes, siteUrls } from "@/config/urls"; | ||
import { getBlogs } from "@/server/actions/blog"; | ||
import { getDocs } from "@/server/actions/docs"; | ||
import type { MetadataRoute } from "next"; | ||
|
||
const addPathToBaseURL = (path: string) => `${siteUrls.publicUrl}${path}`; | ||
|
||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> { | ||
const allBlogs = await getBlogs(); | ||
|
||
const blogs = allBlogs.map((blog) => ({ | ||
url: addPathToBaseURL(`/${blog.metaData.slug}`), | ||
lastModified: new Date(blog.metaData.updatedAt), | ||
})); | ||
|
||
const allDocs = await getDocs(); | ||
|
||
const docs = allDocs.map((doc) => ({ | ||
url: addPathToBaseURL(`/${doc.metaData.slug}`), | ||
lastModified: new Date(doc.metaData.publishedAt), | ||
})); | ||
|
||
const routes = publicRoutes.map((route) => ({ | ||
url: addPathToBaseURL(route), | ||
lastModified: new Date(), | ||
})); | ||
|
||
return [...routes, ...blogs, ...docs]; | ||
} |
Oops, something went wrong.