Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix seo: updated hn, added SearchAction json ld and corrected category links #961

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const AutocompleteResult = forwardRef<AutocompleteResultProps, 'div'>(
{items.length === 0 && searchNotFound && (
<Box textAlign="center" px="xl" py="m">
<img src={getPathFile('/imgs/not-found.png')} alt="not-found" />
<Heading size="m" mt="s">
<Heading as="p" size="m" mt="s">
{searchNotFound.title}
</Heading>
<Text size="xs" mt="xxs">
Expand Down
4 changes: 3 additions & 1 deletion src/components/CookieConsent/CookieConsent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export const CookieConsent: React.FC<CookieConsentProps> = ({
}) => {
return (
<Box className="cookie-consent">
<Heading size="s">{title}</Heading>
<Heading as="p" size="s">
{title}
</Heading>
<Text mt="xs" size="s">
{description}
</Text>
Expand Down
4 changes: 3 additions & 1 deletion src/components/NewsletterBlock/NewsletterBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export const NewsletterBlock: React.FC<NewsletterBlockProps> = ({
<Text size="s" mt={{ xs: 's', md: '0' }}>
{title}
</Text>
<Heading size="l">{description}</Heading>
<Heading as="p" size="l">
{description}
</Heading>
<Button {...(subscribeButtonProps as ButtonProps)} mt={{ xs: 'm', md: 'l' }}>
{subscribeButtonLabel}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NotFoundBlock/NotFoundBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type NotFoundBlockProps = Omit<FlexProps, 'title'> & NotFoundBlockOptions
export const NotFoundBlock: React.FC<NotFoundBlockProps> = ({ title, description, ...props }) => (
<Flex {...props} flexDirection="column" alignItems="center" mt="m" className="not-found-block">
<img src={getPathFile('/imgs/not-found.png')} alt="not-found" />
<Heading size="l" mt="s">
<Heading as="p" size="l" mt="s">
{title}
</Heading>
<Text size="s" mt="xxs">
Expand Down
2 changes: 1 addition & 1 deletion src/config/website/common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const blogUrl = 'https://blog.eleven-labs.com';
export const websiteUrl = 'https://eleven-labs.com';
export const newsletterFormUrl = 'http://eepurl.com/cOuOIf';
export const googleSiteVerificationKey = 'google-site-verification';
export const googleSiteVerificationKey = 'KJe_sMzZb1SHlPfw4dQjwOw2lFJAJysJP27bRKT7Zxk';
export const googleAnalytics = {
trackingCode: 'UA-99013054-1',
trackingCodeAnonymized: 'UA-99013054-9',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useHead, useLink, useMeta, useScript } from 'hoofd';
import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation } from 'react-router-dom';
import { matchPath, useLocation } from 'react-router-dom';

import { googleSiteVerificationKey, themeColor } from '@/config/website';
import { PATHS } from '@/constants';
import { CookieConsentContainer } from '@/containers/CookieConsentContainer';
import { HeaderContainer } from '@/containers/HeaderContainer';
import { useFooterContainer } from '@/containers/LayoutTemplateContainer/useFooterContainer';
Expand All @@ -14,6 +15,7 @@ export const useLayoutTemplateContainer = (): Omit<LayoutTemplateProps, 'childre
const { i18n } = useTranslation();
const location = useLocation();
const footer = useFooterContainer();
const isHomePage = Boolean(matchPath(PATHS.ROOT, location.pathname));

useHead({
metas: [
Expand Down Expand Up @@ -42,6 +44,18 @@ export const useLayoutTemplateContainer = (): Omit<LayoutTemplateProps, 'childre
'@type': 'WebSite',
name: 'Blog Eleven Labs',
url: 'https://blog.eleven-labs.com/',
...(isHomePage
? {
potentialAction: {
'@type': 'SearchAction',
target: {
'@type': 'EntryPoint',
urlTemplate: 'https://blog.eleven-labs.com/fr/search/?search={search_term_string}',
},
'query-input': 'required name=search_term_string',
},
}
: {}),
}),
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { generatePath, useLoaderData, useParams } from 'react-router-dom';
import { useLoaderData, useParams } from 'react-router-dom';

import { PATHS } from '@/constants';
import { LinkContainer } from '@/containers/LinkContainer';
import { PostPreviewListContainer } from '@/containers/PostPreviewListContainer';
import { type getDataFromPostListPage } from '@/helpers/contentHelper';
import { generatePath } from '@/helpers/routerHelper';
import { useNewsletterBlock } from '@/hooks/useNewsletterBlock';
import { useTitle } from '@/hooks/useTitle';
import { PostListPageProps } from '@/pages/PostListPage/PostListPage';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PostListPage/SubHeader/SubHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const SubHeader: React.FC<SubHeaderProps> = ({ introBlock, choiceCategory
<Heading as="p" size="m">
{introBlock.title}
</Heading>
<Heading mt="xxs-3" size="xl" className="sub-header__description">
<Heading as="p" mt="xxs-3" size="xl" className="sub-header__description">
{introBlock.description}
</Heading>
<Heading as="p" mt={{ xs: 's', md: 'l' }} size="m">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PostPage/PostHeader/PostHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface PostHeaderProps {

export const PostHeader: React.FC<PostHeaderProps> = ({ title, date, readingTime, authors }) => (
<Box mt={{ xs: 's', md: 'xl' }} textSize="xs">
<Heading as="h2" size="xl">
<Heading as="h1" size="xl">
{title}
</Heading>
<Flex flexDirection={{ xs: 'column', md: 'row' }} mt={{ md: 'xxs-3' }}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PostPage/RelatedPostList/RelatedPostList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface RelatedPostListProps extends BoxProps {

export const RelatedPostList: React.FC<RelatedPostListProps> = ({ relatedPostListTitle, posts, ...boxProps }) => (
<Box {...boxProps} p="m" className="related-post-list">
<Heading mb="m" size="m">
<Heading as="p" mb="m" size="m">
{relatedPostListTitle}
</Heading>
{posts.map((post, index) => (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SearchPage/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const SearchPage: React.FC<SearchPageProps> = ({
<Container variant="content" className="search-page">
{backLink}
<Skeleton isLoading={isLoading}>
<Heading mt="s" size="l">
<Heading as="p" mt="s" size="l">
{title}
</Heading>
</Skeleton>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/LayoutTemplate/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const Footer: React.FC<FooterProps> = ({
<Button {...(elevenLabsSiteLinkProps as typeof Button)}>{elevenLabsSiteLinkLabel}</Button>
</Box>
<Box>
<Heading size="l" mb="s">
<Heading as="p" size="l" mb="s">
{contact.title}
</Heading>
<Flex flexDirection={{ xs: 'column', md: 'row' }} gap={{ md: 'xl' }}>
Expand Down