Skip to content

Commit

Permalink
fix: semantic tags
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Sep 14, 2024
1 parent ce3d2c9 commit f9eacd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ export default async function Page({ params }: Props) {

return (
<>
<div className={cn('mb-6 mt-8 border-b', 'border-outline-variant/50')}>
<header className={cn('mb-6 mt-8 border-b', 'border-outline-variant/50')}>
<h1 className="mb-2 text-5xl font-bold tracking-tighter">{doc.title}</h1>
{!!doc?.description?.length && (
<p className={cn('my-2 text-base leading-5', 'text-on-surface-variant/50')}>
{doc.description}
</p>
)}
</div>
</header>
{doc ? <>{doc.content}</> : 'empty doc'}
</>
)
Expand Down
12 changes: 10 additions & 2 deletions src/components/mdx/Intro/Intro.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import cn from '@/lib/cn'
import { VisuallyHidden } from '@radix-ui/react-visually-hidden'
import { ComponentProps } from 'react'

export function Intro({ className, ...props }: ComponentProps<'div'>) {
return <div {...props} className={cn(className, 'my-6 text-xl leading-relaxed')} />
export function Intro({ children, className, ...props }: ComponentProps<'div'>) {
return (
<section {...props} className={cn(className, 'my-6 text-xl leading-relaxed')}>
<VisuallyHidden>
<h2>Summary</h2>
</VisuallyHidden>
{children}
</section>
)
}

0 comments on commit f9eacd6

Please sign in to comment.