Skip to content

Commit

Permalink
DOCS-103 Metadescription prop in mdx for SEO (#1476)
Browse files Browse the repository at this point in the history
* test description field

* clean up
  • Loading branch information
KaustubhKumar05 authored Apr 13, 2023
1 parent 562c7fb commit 38ec82f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion layouts/DocLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Header from '@/components/Header';
import SegmentAnalytics from '@/components/SegmentAnalytics';
import Sidebar from '@/components/Sidebar';
import useLockBodyScroll from '@/lib/useLockBodyScroll';
import { SEOText } from '@/lib/utils';

interface Props {
children: JSX.Element;
Expand All @@ -16,8 +17,10 @@ export default function DocLayout({ children }: Props) {
const router = useRouter() as any;
const SEO = {
title: `${frontMatter.title || '100ms Docs'} | 100ms`,
description: frontMatter?.description || SEOText,
openGraph: {
title: `${frontMatter.title || '100ms Docs'} | 100ms`
title: `${frontMatter.title || '100ms Docs'} | 100ms`,
description: frontMatter?.description || SEOText
},
canonical: `${process.env.NEXT_PUBLIC_CANONICAL_BASE_URL}${
router.asPath === '/' ? '' : router.asPath.split('?')[0]
Expand Down
3 changes: 3 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ export const GitHubLink = 'https://github.com/100mslive';
export const WebsiteLink = 'https://www.100ms.live';

export const ContactLink = `${WebsiteLink}/contact`;

export const SEOText =
'Quick to integrate native iOS, Android & Web SDKs to add live video & audio conferencing to your applications.';
2 changes: 1 addition & 1 deletion pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,4 @@ export const getStaticPaths = async () => {
};
};

DocSlugs.Layout = DocLayout
DocSlugs.Layout = DocLayout;

1 comment on commit 38ec82f

@vercel
Copy link

@vercel vercel bot commented on 38ec82f Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.