Skip to content

Commit

Permalink
Merge pull request #224 from nekochans/feature/issue223
Browse files Browse the repository at this point in the history
重複コンテンツ回避の為、SEO対策
  • Loading branch information
keitakn authored Nov 1, 2022
2 parents 7ab9c43 + 4a4cca5 commit d941e8d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/features/metaTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ export const customErrorTitle = (language: Language): string => {
}
};

const topPageTitle = (language: Language): string => {
switch (language) {
case 'ja':
return `${defaultTitle} 猫好きのためのLGTM画像共有サービス`;
case 'en':
return `${defaultTitle} | LGTM image share service for cat lovers`;
default:
return assertNever(language);
}
};

const uploadPageTitle = (language: Language): string => {
switch (language) {
case 'ja':
Expand Down Expand Up @@ -100,7 +111,7 @@ type MetaTagList = {

export const metaTagList = (language: Language): MetaTagList => ({
top: {
title: `${defaultTitle} | LGTM image share service for cat lovers`,
title: topPageTitle(language),
ogpImgUrl: appUrlList.ogpImg,
ogpTargetUrl: appUrlList.top,
appName,
Expand Down
5 changes: 5 additions & 0 deletions src/layouts/DefaultLayout/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export const DefaultLayout: FC<Props> = ({
<title>{metaTag.title}</title>
<meta charSet="utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
{metaTag.description != null ? (
<meta name="description" content={metaTag.description} />
) : (
''
)}
<meta property="og:title" content={metaTag.title} />
<meta property="og:description" content={metaTag.description} />
<meta property="og:type" content="website" />
Expand Down

1 comment on commit d941e8d

@vercel
Copy link

@vercel vercel bot commented on d941e8d Nov 1, 2022

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.