Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
feat: Update SEO title
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeine-addictt committed Mar 17, 2024
1 parent f61798b commit 17d5902
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pages/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function Text({ children, className }) {return <p className={cn('text-sm
<VersionLink className='w-56 flex-col justify-between items-start' href='/docs/latest'>
<div className='flex flex-row items-center gap-2'>
<ExternalLinkIcon className='w-6 h-6' />
<Text className='text-lg font-bold'>Latest 1.1.0</Text>
<Text className='text-lg font-bold'>Latest 1.1.1</Text>
</div>
<Text className='text-sm font-light text-left ml-4'>This is the latest ***stable*** release.</Text>
<div className='flex flex-row self-end mt-auto mb-1 gap-2'>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Thread v1.1.1
---

import Link from 'next/link'

import { ChevronDownIcon, ArrowRightIcon } from '@radix-ui/react-icons'
Expand Down
12 changes: 9 additions & 3 deletions theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const Footer = (
)
const Head = () => {
const { title } = useConfig()
const { route } = useRouter()

const pageTitle = route === '/' || !title ? 'Thread v1.1.1' : `${title} | Thread v1.1.1`
const socialImage = 'https://thread.ngjx.org/socialcard-white.jpg'

return (
Expand All @@ -50,7 +53,7 @@ const Head = () => {

{/* OpenGraph */}
<meta name='og:image' content={socialImage} />
<meta name='og:title' content={title ? title + ' - thread' : 'thread'} />
<meta name='og:title' content={pageTitle} />

{/* Twitter */}
<meta name='twitter:card' content='summary_large_image' />
Expand Down Expand Up @@ -78,8 +81,11 @@ const config: DocsThemeConfig = {
link: 'https://discord.gg/WTAvycRmqP'
},
useNextSeoProps() {
return {
titleTemplate: '%s – thread'
const { asPath } = useRouter()
if (asPath !== '/') {
return {
titleTemplate: '%s | Thread v1.1.1',
}
}
},
sidebar: {
Expand Down

0 comments on commit 17d5902

Please sign in to comment.