Skip to content

Commit

Permalink
Merge pull request #2376 from starknet-io/bugfix/improve-seo
Browse files Browse the repository at this point in the history
Add SEO updates
  • Loading branch information
rafaelcruzazevedo authored Feb 1, 2024
2 parents 465f44d + 6141dad commit 06941b7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
19 changes: 19 additions & 0 deletions _data/settings/redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,22 @@ items:
destination: /:locale/content
- source: /posts
destination: /en/content
- source: /en/posts/757155c6-ce07-49f1-af21-907b7e0b1cb1
destination: https://www.starknet.io/en/content
- source: /en/announcements
destination: https://www.starknet.io/en/content
- source: /en/announcements/product-update-april-2023
destination: https://www.starknet.io/en/content
- source: /en/posts/757155c6-ce07-49f1-af21-907b7e0b1cb1/introducing-the-starknet-foundation
destination: https://www.starknet.io/en/content/introducing-the-starknet-foundation
- source: /en/
destination: https://www.starknet.io/en
- source: /en/announcements
destination: https://www.starknet.io/en/content
- source: /en/home
destination: https://www.starknet.io/en
- source: /en/announcements/product-update-april-2023
destination: https://www.starknet.io/en/content
- source: /en/posts/757155c6-ce07-49f1-af21-907b7e0b1cb1
destination: https://www.starknet.io/en/content

2 changes: 1 addition & 1 deletion _data/tutorials/0cairows02.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ id: 0cairows02
type: youtube
url: https://youtu.be/51Qb3TLpNro
image: /assets/cairows02.jpeg
title: "Account abstraction "
title: "Starknet Workshop #1 - Account Abstraction"
authors:
- author: StarkWare
published_at: 2022-08-15T23:00:00.000Z
Expand Down
9 changes: 5 additions & 4 deletions workspaces/website/src/blocks/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ import VideoSectionBlock from "./VideoSectionBlock";
import { NewsletterCard } from "@ui/Card/NewsletterCard";

interface Props {
disallowH1?: boolean;
readonly block: TopLevelBlock;
env: {
CLOUDFLARE_RECAPTCHA_KEY: string;
}
readonly locale: string;
}

export function Block({ block, env, locale }: Props): JSX.Element | null {
export function Block({ disallowH1, block, env, locale }: Props): JSX.Element | null {
if (block.type === "basic_card") {
return <BasicCard {...block} locale={locale} />;
} else if (block.type === "container") {
Expand All @@ -50,7 +51,7 @@ export function Block({ block, env, locale }: Props): JSX.Element | null {
} else if (block.type === "newsletter_popup") {
return <NewsletterCard {...block} env={env} locale={locale} />;
} else if (block.type === "markdown") {
return <MarkdownBlock body={block.body} /> ;
return <MarkdownBlock disallowH1={disallowH1} body={block.body} /> ;
} else if (block.type === "ambassadors_list") {
return <AmbassadorsList {...block} />;
} else if (block.type === "community_events") {
Expand Down Expand Up @@ -88,7 +89,7 @@ export function Block({ block, env, locale }: Props): JSX.Element | null {
<AccordionRoot heading={block.heading}>
{block.blocks?.map((block, i) => (
<AccordionItem key={i} label={block.label}>
<MarkdownBlock body={block.body} />
<MarkdownBlock disallowH1={disallowH1} body={block.body} />
</AccordionItem>
))}
</AccordionRoot>
Expand All @@ -103,7 +104,7 @@ export function Block({ block, env, locale }: Props): JSX.Element | null {
{blocks.map((block: any, i: number) => {
return (
<OrderedBlockItem key={i} title={block.title}>
<MarkdownBlock body={block.body} />
<MarkdownBlock disallowH1={disallowH1} body={block.body} />
</OrderedBlockItem>
);
})}
Expand Down
5 changes: 3 additions & 2 deletions workspaces/website/src/blocks/MarkdownBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import CodeHighlight from "@ui/CodeHighlight/CodeHighlight";
import remarkGfm from 'remark-gfm'
import '../style/table.css'
interface Props {
readonly disallowH1?: boolean;
readonly body: string;
}

export function MarkdownBlock({ body }: Props): JSX.Element {
export function MarkdownBlock({ disallowH1, body }: Props): JSX.Element {
return (
<Box>
<ReactMarkdown
Expand All @@ -31,7 +32,7 @@ export function MarkdownBlock({ body }: Props): JSX.Element {
id={`toc-${slugify(props.children.join(" "))}`}
/> */}
<Heading
as={"h1"}
as={disallowH1 ? "h2" : "h1"}
id={`toc-${slugify(props.children.join(" "))}`}
color="heading-navy-fg"
variant="h2"
Expand Down
1 change: 1 addition & 0 deletions workspaces/website/src/pages/content/@slug/PostPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export function PostPage(props: Props): JSX.Element {
<Flex direction="column" gap="32px" marginBottom={'96px'}>
{post.blocks?.map((block, i) => (
<Block
disallowH1
key={i}
block={block}
locale={locale}
Expand Down

0 comments on commit 06941b7

Please sign in to comment.