-
-
Notifications
You must be signed in to change notification settings - Fork 17
feat: SEO updates #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: SEO updates #160
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Notify IndexNow | ||
|
|
||
| on: | ||
| deployment_status: | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.deployment.environment || 'Production' }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| submit: | ||
| if: >- | ||
| github.event_name == 'workflow_dispatch' || | ||
| (github.event.deployment_status.state == 'success' && | ||
| github.event.deployment.environment == 'Production') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
coderabbitai[bot] marked this conversation as resolved.
WINOFFRG marked this conversation as resolved.
|
||
| with: | ||
| persist-credentials: false | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: 1.2.19 | ||
| - name: Submit canonical sitemap URLs | ||
| env: | ||
| INDEXNOW_KEY: ${{ secrets.INDEXNOW_KEY }} | ||
| INDEXNOW_SITE_URL: https://limeplay.winoffrg.dev | ||
| run: bun apps/www/scripts/submit-indexnow.ts | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ import { BlockPageShell } from "@/components/blocks/block-page-shell" | |||||||||||||||||||||||||||
| import { getBlockShowcase } from "@/components/blocks/block-showcase" | ||||||||||||||||||||||||||||
| import { BlockInfoPane } from "@/components/blocks/info-pane" | ||||||||||||||||||||||||||||
| import { getMDXComponents } from "@/components/mdx-components" | ||||||||||||||||||||||||||||
| import { PageJsonLd } from "@/components/page-json-ld" | ||||||||||||||||||||||||||||
| import { blocksSource } from "@/lib/blocks-source" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| export const revalidate = false | ||||||||||||||||||||||||||||
|
|
@@ -28,6 +29,9 @@ export default async function BlockPage(props: BlockPageProps) { | |||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| const showcase = getBlockShowcase(page.data.preview) | ||||||||||||||||||||||||||||
| const description = | ||||||||||||||||||||||||||||
| page.data.description ?? | ||||||||||||||||||||||||||||
| `Install and customize the ${page.data.title} block for Limeplay.` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| const MDXContent = page.data.body | ||||||||||||||||||||||||||||
| const PreviewComponent = showcase.component | ||||||||||||||||||||||||||||
|
|
@@ -65,6 +69,17 @@ export default async function BlockPage(props: BlockPageProps) { | |||||||||||||||||||||||||||
| tree={blocksSource.getPageTree()} | ||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||
| <main className="relative min-h-svh overflow-x-hidden bg-background"> | ||||||||||||||||||||||||||||
| {/* TODO: Point this breadcrumb to /blocks once the blocks index page exists. */} | ||||||||||||||||||||||||||||
| <PageJsonLd | ||||||||||||||||||||||||||||
| breadcrumbs={[ | ||||||||||||||||||||||||||||
| { name: "Home", path: "/" }, | ||||||||||||||||||||||||||||
| { name: "Blocks", path: "/blocks/video-player" }, | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The "Blocks" breadcrumb item is hardcoded to Prompt for AI agents |
||||||||||||||||||||||||||||
| { name: page.data.title, path: page.url }, | ||||||||||||||||||||||||||||
| ]} | ||||||||||||||||||||||||||||
|
Comment on lines
+72
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win Remove the invalid Blocks breadcrumb until the index page exists. Line 76 links the Proposed fix <PageJsonLd
breadcrumbs={[
{ name: "Home", path: "/" },
- { name: "Blocks", path: "/blocks/video-player" },
{ name: page.data.title, path: page.url },
]}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| description={description} | ||||||||||||||||||||||||||||
| path={page.url} | ||||||||||||||||||||||||||||
| title={`${page.data.title} Block`} | ||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||
| <script | ||||||||||||||||||||||||||||
| dangerouslySetInnerHTML={{ | ||||||||||||||||||||||||||||
| __html: ` | ||||||||||||||||||||||||||||
|
|
@@ -96,9 +111,25 @@ export async function generateMetadata( | |||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| if (!page) notFound() | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| const description = | ||||||||||||||||||||||||||||
| page.data.description ?? | ||||||||||||||||||||||||||||
| `Install and customize the ${page.data.title} block for Limeplay.` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||
| description: page.data.description, | ||||||||||||||||||||||||||||
| alternates: { | ||||||||||||||||||||||||||||
| canonical: page.url, | ||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||
| description, | ||||||||||||||||||||||||||||
| openGraph: { | ||||||||||||||||||||||||||||
| description, | ||||||||||||||||||||||||||||
| title: `${page.data.title} Block`, | ||||||||||||||||||||||||||||
| url: page.url, | ||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||
| title: `${page.data.title} Block`, | ||||||||||||||||||||||||||||
| twitter: { | ||||||||||||||||||||||||||||
| description, | ||||||||||||||||||||||||||||
| title: `${page.data.title} Block`, | ||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,7 @@ import { notFound } from "next/navigation" | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| import { LLMCopyButton, ViewOptions } from "@/components/ai/page-actions" | ||||||||||||||||||||||||||||||||||||
| import { getMDXComponents } from "@/components/mdx-components" | ||||||||||||||||||||||||||||||||||||
| import { PageJsonLd } from "@/components/page-json-ld" | ||||||||||||||||||||||||||||||||||||
| import { getPageImage, source } from "@/lib/source" | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| export async function generateMetadata(props: { | ||||||||||||||||||||||||||||||||||||
|
|
@@ -20,12 +21,28 @@ export async function generateMetadata(props: { | |||||||||||||||||||||||||||||||||||
| const page = source.getPage(params.slug) | ||||||||||||||||||||||||||||||||||||
| if (!page) notFound() | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| const canonicalPath = getCanonicalPath(page.slugs, page.url) | ||||||||||||||||||||||||||||||||||||
| const description = getPageDescription(page.data.title, page.data.description) | ||||||||||||||||||||||||||||||||||||
| const imageUrl = getPageImage(page).url | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||
| description: page.data.description, | ||||||||||||||||||||||||||||||||||||
| alternates: { | ||||||||||||||||||||||||||||||||||||
| canonical: canonicalPath, | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| description, | ||||||||||||||||||||||||||||||||||||
| openGraph: { | ||||||||||||||||||||||||||||||||||||
| images: getPageImage(page).url, | ||||||||||||||||||||||||||||||||||||
| description, | ||||||||||||||||||||||||||||||||||||
| images: imageUrl, | ||||||||||||||||||||||||||||||||||||
| title: page.data.title, | ||||||||||||||||||||||||||||||||||||
| type: "article", | ||||||||||||||||||||||||||||||||||||
| url: canonicalPath, | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| title: page.data.title, | ||||||||||||||||||||||||||||||||||||
| twitter: { | ||||||||||||||||||||||||||||||||||||
| description, | ||||||||||||||||||||||||||||||||||||
| images: imageUrl, | ||||||||||||||||||||||||||||||||||||
| title: page.data.title, | ||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
|
|
@@ -41,16 +58,40 @@ export default async function Page(props: { | |||||||||||||||||||||||||||||||||||
| if (!page) notFound() | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| const MDXContent = page.data.body | ||||||||||||||||||||||||||||||||||||
| const canonicalPath = getCanonicalPath(page.slugs, page.url) | ||||||||||||||||||||||||||||||||||||
| const markdownUrl = `/llms.mdx/${page.slugs.join("/")}.mdx` | ||||||||||||||||||||||||||||||||||||
| const description = getPageDescription(page.data.title, page.data.description) | ||||||||||||||||||||||||||||||||||||
| const parentBreadcrumbs = page.slugs.slice(0, -1).map((slug, slugIndex) => ({ | ||||||||||||||||||||||||||||||||||||
| name: slug | ||||||||||||||||||||||||||||||||||||
| .split("-") | ||||||||||||||||||||||||||||||||||||
| .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) | ||||||||||||||||||||||||||||||||||||
| .join(" "), | ||||||||||||||||||||||||||||||||||||
| path: `/docs/${page.slugs.slice(0, slugIndex + 1).join("/")}`, | ||||||||||||||||||||||||||||||||||||
| })) | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+64
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Block pages publish a Prompt for AI agents
Suggested change
|
||||||||||||||||||||||||||||||||||||
| const breadcrumbs = [ | ||||||||||||||||||||||||||||||||||||
| { name: "Home", path: "/" }, | ||||||||||||||||||||||||||||||||||||
| ...(page.url === "/docs/quick-start" | ||||||||||||||||||||||||||||||||||||
| ? [] | ||||||||||||||||||||||||||||||||||||
| : [{ name: "Documentation", path: "/docs/quick-start" }]), | ||||||||||||||||||||||||||||||||||||
| ...parentBreadcrumbs, | ||||||||||||||||||||||||||||||||||||
| { name: page.data.title, path: canonicalPath }, | ||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||
| <DocsPage full={page.data.full} toc={page.data.toc}> | ||||||||||||||||||||||||||||||||||||
| <PageJsonLd | ||||||||||||||||||||||||||||||||||||
| breadcrumbs={breadcrumbs} | ||||||||||||||||||||||||||||||||||||
| description={description} | ||||||||||||||||||||||||||||||||||||
| path={canonicalPath} | ||||||||||||||||||||||||||||||||||||
| title={page.data.title} | ||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||
| <DocsTitle>{page.data.title}</DocsTitle> | ||||||||||||||||||||||||||||||||||||
| <DocsDescription>{page.data.description}</DocsDescription> | ||||||||||||||||||||||||||||||||||||
| <DocsDescription>{description}</DocsDescription> | ||||||||||||||||||||||||||||||||||||
| <div className="flex flex-row flex-wrap items-center gap-2 pb-6"> | ||||||||||||||||||||||||||||||||||||
| <LLMCopyButton markdownUrl={`${page.url}.mdx`} /> | ||||||||||||||||||||||||||||||||||||
| <LLMCopyButton markdownUrl={markdownUrl} /> | ||||||||||||||||||||||||||||||||||||
| <ViewOptions | ||||||||||||||||||||||||||||||||||||
| githubUrl={`https://github.com/winoffrg/limeplay/blob/main/apps/www/content/docs/${page.path}`} | ||||||||||||||||||||||||||||||||||||
| markdownUrl={`${page.url}.mdx`} | ||||||||||||||||||||||||||||||||||||
| markdownUrl={markdownUrl} | ||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||
| <DocsBody> | ||||||||||||||||||||||||||||||||||||
|
|
@@ -63,3 +104,18 @@ export default async function Page(props: { | |||||||||||||||||||||||||||||||||||
| </DocsPage> | ||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| function getCanonicalPath(slugs: string[], pageUrl: string) { | ||||||||||||||||||||||||||||||||||||
| if (slugs[0] === "blocks") { | ||||||||||||||||||||||||||||||||||||
| return `/blocks/${slugs.slice(1).join("/")}` | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| return pageUrl | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| function getPageDescription(title: string, description?: string) { | ||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||
| description ?? | ||||||||||||||||||||||||||||||||||||
| `Learn how ${title} works in Limeplay's React media player component system.` | ||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| export const dynamic = "force-static" | ||
|
WINOFFRG marked this conversation as resolved.
|
||
| export const revalidate = false | ||
|
|
||
| export function GET() { | ||
| const key = process.env.INDEXNOW_KEY | ||
|
|
||
| if (!key) { | ||
| return new Response("IndexNow is not configured.\n", { | ||
| headers: { | ||
| "Content-Type": "text/plain; charset=utf-8", | ||
| "X-Robots-Tag": "noindex, nofollow, nosnippet", | ||
| }, | ||
| status: 404, | ||
| }) | ||
| } | ||
|
|
||
| return new Response(`${key}\n`, { | ||
| headers: { | ||
| "Content-Type": "text/plain; charset=utf-8", | ||
| "X-Robots-Tag": "noindex, nofollow, nosnippet", | ||
| }, | ||
| }) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,9 @@ | ||
| import { getLLMText } from "@/lib/get-llm-text" | ||
| import { source } from "@/lib/source" | ||
| import { buildLLMsText, LLM_RESPONSE_HEADERS } from "@/lib/llms" | ||
|
|
||
| export const revalidate = false | ||
|
|
||
| export async function GET() { | ||
| const scan = source.getPages().map(getLLMText) | ||
| const scanned = await Promise.all(scan) | ||
|
|
||
| return new Response(scanned.join("\n\n")) | ||
| return new Response(buildLLMsText({ includeAllDocs: true }), { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Prompt for AI agents |
||
| headers: LLM_RESPONSE_HEADERS, | ||
| }) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,9 @@ | ||
| import { source } from "@/lib/source" | ||
| import { buildLLMsText, LLM_RESPONSE_HEADERS } from "@/lib/llms" | ||
|
|
||
| export const revalidate = false | ||
|
|
||
| export async function GET() { | ||
| const scanned: string[] = [] | ||
| scanned.push("# Docs") | ||
| const map = new Map<string, string[]>() | ||
|
|
||
| for (const page of source.getPages()) { | ||
| const dir = page.slugs[0] | ||
| const list = map.get(dir) ?? [] | ||
| list.push(`- [${page.data.title}](${page.url}): ${page.data.description}`) | ||
| map.set(dir, list) | ||
| } | ||
|
|
||
| for (const [key, value] of map) { | ||
| scanned.push(`## ${key}`) | ||
| scanned.push(value.join("\n")) | ||
| } | ||
|
|
||
| return new Response(scanned.join("\n\n")) | ||
| return new Response(buildLLMsText(), { | ||
| headers: LLM_RESPONSE_HEADERS, | ||
| }) | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.