Skip to content

Commit

Permalink
feat: add seo description
Browse files Browse the repository at this point in the history
  • Loading branch information
nermalcat69 committed Sep 29, 2024
1 parent fc117d4 commit 7352ff2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
1 change: 1 addition & 0 deletions apps/docs/content/help/faq.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Frequently Asked Questions
description: Get quick answers to your related questions about Zerops from frequently asked questions we get asked by people.
---
import Accordion from "/src/components/Accordion"
import { FAQ, FAQItem } from "/src/components/Faq"
Expand Down
54 changes: 32 additions & 22 deletions apps/docs/src/theme/DocItem/Content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import MDXContent from "@theme/MDXContent"
import type { Props } from "@theme/DocItem/Content"
import { DocContextValue } from "@medusajs/docs"
import { Badge, BadgeVariant } from "docs-ui"
import Head from "@docusaurus/Head"

/**
Title can be declared inside md content or declared through
Expand All @@ -30,37 +31,46 @@ function useSyntheticTitle(): string | null {

export default function DocItemContent({ children }: Props): JSX.Element {
const {
frontMatter: { badge },
frontMatter: { badge, description },
metadata,
} = useDoc() as DocContextValue
const syntheticTitle = useSyntheticTitle()

return (
<div className={clsx(ThemeClassNames.docs.docMarkdown, "markdown")}>
{syntheticTitle && (
<header
className={clsx(badge && "md:flex md:items-center md:gap-0.5 mb-2")}
>
<Heading as="h1" className={clsx(badge && "!mb-0")}>
{syntheticTitle}
<>
<Head>
<title>{metadata.title} - Zerops</title>
{description && <meta name="description" content={description} />}
</Head>

<div className={clsx(ThemeClassNames.docs.docMarkdown, "markdown")}>
{syntheticTitle && (
<header
className={clsx(badge && "md:flex md:items-center md:gap-0.5 mb-2")}
>
<Heading as="h1" className={clsx(badge && "!mb-0")}>
{syntheticTitle}
{badge && (
<Badge
variant={badge.variant as BadgeVariant}
className="md:hidden ml-1 align-middle"
>
{badge.text}
</Badge>
)}
</Heading>
{badge && (
<Badge
variant={badge.variant as BadgeVariant}
className="md:hidden ml-1 align-middle"
className={clsx("md:block hidden")}
>
{badge.text}
</Badge>
)}
</Heading>
{badge && (
<Badge
variant={badge.variant as BadgeVariant}
className={clsx("md:block hidden")}
>
{badge.text}
</Badge>
)}
</header>
)}
<MDXContent>{children}</MDXContent>
</div>
</header>
)}
<MDXContent>{children}</MDXContent>
</div>
</>
)
}

0 comments on commit 7352ff2

Please sign in to comment.