Add canonical
This commit is contained in:
@@ -2,5 +2,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
siteUrl: process.env.SITE_URL || 'https://www.abyss-lab.app',
|
siteUrl: process.env.SITE_URL || 'https://www.abyss-lab.app',
|
||||||
generateRobotsTxt: true,
|
generateRobotsTxt: true,
|
||||||
exclude: ['*/prints/*'],
|
exclude: ['*/temp/*'],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
import NextHead from 'next/head'
|
import NextHead from 'next/head'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
import { baseUrl } from '../../lib/consts'
|
||||||
|
|
||||||
interface HeadProps {
|
interface HeadProps {
|
||||||
title: string
|
title: string
|
||||||
description?: string
|
description?: string
|
||||||
|
canonicalHref?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const Head = ({ title, description }: HeadProps) => {
|
const Head = ({ title, description, canonicalHref }: HeadProps) => {
|
||||||
|
const { locale } = useRouter()
|
||||||
return (
|
return (
|
||||||
<NextHead>
|
<NextHead>
|
||||||
<title>{title}</title>
|
<title>{title}</title>
|
||||||
@@ -19,6 +23,14 @@ const Head = ({ title, description }: HeadProps) => {
|
|||||||
/>
|
/>
|
||||||
<meta property='og:title' content={title} key='title' />
|
<meta property='og:title' content={title} key='title' />
|
||||||
<meta property='og:description' content={description} key='description' />
|
<meta property='og:description' content={description} key='description' />
|
||||||
|
{canonicalHref && (
|
||||||
|
<link
|
||||||
|
rel='canonical'
|
||||||
|
href={`${baseUrl}${
|
||||||
|
locale === 'en-US' ? '' : '/ko-KR'
|
||||||
|
}${canonicalHref}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</NextHead>
|
</NextHead>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ const SingleStigmataPage = ({
|
|||||||
)} / HP : ${stigmataData.hp} / ATK : ${stigmataData.atk} / DEF : ${
|
)} / HP : ${stigmataData.hp} / ATK : ${stigmataData.atk} / DEF : ${
|
||||||
stigmataData.def
|
stigmataData.def
|
||||||
} / CRT : ${stigmataData.crt}`}
|
} / CRT : ${stigmataData.crt}`}
|
||||||
|
canonicalHref={`/honkai3rd/stigmata/${stigmataData.id}`}
|
||||||
/>
|
/>
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
<Breadcrumb
|
<Breadcrumb
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const StigmataSetPage = ({
|
|||||||
description={`${t('common.honkai-3rd')} ${t(
|
description={`${t('common.honkai-3rd')} ${t(
|
||||||
'stigmata-show.stigmata-set'
|
'stigmata-show.stigmata-set'
|
||||||
)} / ${'⭐'.repeat(stigmataSet.rarity)} / ${stigmataSet.altName}`}
|
)} / ${'⭐'.repeat(stigmataSet.rarity)} / ${stigmataSet.altName}`}
|
||||||
|
canonicalHref={`/honkai3rd/stigmata/${stigmataSet.id}-set`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
export const assetsBucketBaseUrl =
|
export const assetsBucketBaseUrl =
|
||||||
process.env.NEXT_PUBLIC_ASSETS_BUCKET_BASE_URL
|
process.env.NEXT_PUBLIC_ASSETS_BUCKET_BASE_URL
|
||||||
|
export const baseUrl = process.env.NEXT_PUBLIC_BASE_URL
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ const BattlesuitShowPage = ({
|
|||||||
return translate(locale, { 'ko-KR': krLabel }, label)
|
return translate(locale, { 'ko-KR': krLabel }, label)
|
||||||
})
|
})
|
||||||
.join(', ')}`}
|
.join(', ')}`}
|
||||||
|
canonicalHref={`/honkai3rd/battlesuits/${battlesuit.id}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ const BattlesuitListPage = ({ battlesuits }: BattlesuitListPageProps) => {
|
|||||||
'common.abyss-lab'
|
'common.abyss-lab'
|
||||||
)}`}
|
)}`}
|
||||||
description={t('battlesuits-list.description')}
|
description={t('battlesuits-list.description')}
|
||||||
|
canonicalHref={`/honkai3rd/battlesuits`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ const ElfShowPage = ({ elf }: ElfShowPageProps) => {
|
|||||||
return translate(locale, { 'ko-KR': krLabel }, label)
|
return translate(locale, { 'ko-KR': krLabel }, label)
|
||||||
})
|
})
|
||||||
.join(', ')}`}
|
.join(', ')}`}
|
||||||
|
canonicalHref={`/honkai3rd/elfs/${elf.id}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
|
|||||||
'common.abyss-lab'
|
'common.abyss-lab'
|
||||||
)}`}
|
)}`}
|
||||||
description={t('elfs-list.description')}
|
description={t('elfs-list.description')}
|
||||||
|
canonicalHref={`/honkai3rd/elfs`}
|
||||||
/>
|
/>
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
<Breadcrumb
|
<Breadcrumb
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const BattlesuitShowPage = ({
|
|||||||
description={`${t('common.honkai-3rd')} ${t(
|
description={`${t('common.honkai-3rd')} ${t(
|
||||||
'common.elysian-realm'
|
'common.elysian-realm'
|
||||||
)} ${t('battlesuit-show.battlesuit')}`}
|
)} ${t('battlesuit-show.battlesuit')}`}
|
||||||
|
canonicalHref={`/honkai3rd/elysian-realm/battlesuits/${battlesuit.id}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ const ElysianRealmIndexPage = ({
|
|||||||
'common.abyss-lab'
|
'common.abyss-lab'
|
||||||
)}`}
|
)}`}
|
||||||
description={t('common.elysian-realm')}
|
description={t('common.elysian-realm')}
|
||||||
|
canonicalHref={`/honkai3rd/elysian-realm`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ const ElysianRealmIndexPage = ({
|
|||||||
description={`${t('common.elysian-realm')} ${t(
|
description={`${t('common.elysian-realm')} ${t(
|
||||||
'elysian-realm.supports'
|
'elysian-realm.supports'
|
||||||
)}`}
|
)}`}
|
||||||
|
canonicalHref={`/honkai3rd/elysian-realm/remembrance-sigils`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ const SignetShowPage = ({ signetId, signetGroup }: SignetShowPageProps) => {
|
|||||||
description={`${t('common.honkai-3rd')} ${signetGroup.name} ${t(
|
description={`${t('common.honkai-3rd')} ${signetGroup.name} ${t(
|
||||||
'elysian-realm.signets'
|
'elysian-realm.signets'
|
||||||
)}`}
|
)}`}
|
||||||
|
canonicalHref={`/honkai3rd/elysian-realm/signets/${signetId}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ const ElysianRealmIndexPage = ({
|
|||||||
description={`${t('common.elysian-realm')} ${t(
|
description={`${t('common.elysian-realm')} ${t(
|
||||||
'elysian-realm.supports'
|
'elysian-realm.supports'
|
||||||
)}`}
|
)}`}
|
||||||
|
canonicalHref={`/honkai3rd/elysian-realm/support-battlesuits`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import {
|
|||||||
import { listStigmata } from '../../../../server/data/honkai3rd/stigmata'
|
import { listStigmata } from '../../../../server/data/honkai3rd/stigmata'
|
||||||
import { listWeapons } from '../../../../server/data/honkai3rd/weapons'
|
import { listWeapons } from '../../../../server/data/honkai3rd/weapons'
|
||||||
import { getI18NProps } from '../../../../server/i18n'
|
import { getI18NProps } from '../../../../server/i18n'
|
||||||
|
import Head from '../../../../components/atoms/Head'
|
||||||
|
import { useTranslation } from 'next-i18next'
|
||||||
|
|
||||||
interface GenerateGuidePageProps {
|
interface GenerateGuidePageProps {
|
||||||
weapons: WeaponData[]
|
weapons: WeaponData[]
|
||||||
@@ -36,9 +38,16 @@ const GenerateGuidePage = ({
|
|||||||
sigils,
|
sigils,
|
||||||
}: GenerateGuidePageProps) => {
|
}: GenerateGuidePageProps) => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const { t } = useTranslation()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
|
<Head
|
||||||
|
title={`ER Guide Generator- ${t('common.honkai-3rd')} - ${t(
|
||||||
|
'common.abyss-lab'
|
||||||
|
)}`}
|
||||||
|
canonicalHref={`/honkai3rd/elysian-realm/utils/gen-guide`}
|
||||||
|
/>
|
||||||
<Flex m={2} sx={{ alignItems: 'center' }}>
|
<Flex m={2} sx={{ alignItems: 'center' }}>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -62,7 +62,10 @@ const VersionIndexPage = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Honkai3rdLayout>
|
<Honkai3rdLayout>
|
||||||
<Head title={`${t('common.honkai-3rd')} - ${t('common.abyss-lab')}`} />
|
<Head
|
||||||
|
title={`${t('common.honkai-3rd')} - ${t('common.abyss-lab')}`}
|
||||||
|
canonicalHref={`/honkai3rd`}
|
||||||
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
<Breadcrumb
|
<Breadcrumb
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ const StigmataListPage = ({
|
|||||||
'common.abyss-lab'
|
'common.abyss-lab'
|
||||||
)}`}
|
)}`}
|
||||||
description={t('stigmata-list.description')}
|
description={t('stigmata-list.description')}
|
||||||
|
canonicalHref={`/honkai3rd/stigmata`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
+17
-17
@@ -10,29 +10,29 @@ import {
|
|||||||
} from '@theme-ui/components'
|
} from '@theme-ui/components'
|
||||||
import { NextPageContext } from 'next'
|
import { NextPageContext } from 'next'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import BattlesuitFeatureLabel from '../../../../components/atoms/BattlesuitFeatureLabel'
|
import BattlesuitFeatureLabel from '../../../../../components/atoms/BattlesuitFeatureLabel'
|
||||||
import BattlesuitRankIcon from '../../../../components/atoms/BattlesuitRankIcon'
|
import BattlesuitRankIcon from '../../../../../components/atoms/BattlesuitRankIcon'
|
||||||
import PageLink from '../../../../components/atoms/PageLink'
|
import PageLink from '../../../../../components/atoms/PageLink'
|
||||||
import SecondaryLabel from '../../../../components/atoms/SecondaryLabel'
|
import SecondaryLabel from '../../../../../components/atoms/SecondaryLabel'
|
||||||
import TypeLabel from '../../../../components/atoms/TypeLabel'
|
import TypeLabel from '../../../../../components/atoms/TypeLabel'
|
||||||
import ValkyrieLabel from '../../../../components/atoms/ValkyrieLabel'
|
import ValkyrieLabel from '../../../../../components/atoms/ValkyrieLabel'
|
||||||
import {
|
import {
|
||||||
BattlesuitData,
|
BattlesuitData,
|
||||||
BattlesuitSkillGroup,
|
BattlesuitSkillGroup,
|
||||||
} from '../../../../lib/honkai3rd/battlesuits'
|
} from '../../../../../lib/honkai3rd/battlesuits'
|
||||||
import { generateI18NPaths, getI18NProps } from '../../../../server/i18n'
|
import { generateI18NPaths, getI18NProps } from '../../../../../server/i18n'
|
||||||
import {
|
import {
|
||||||
getBattlesuitById,
|
getBattlesuitById,
|
||||||
listBattlesuits,
|
listBattlesuits,
|
||||||
} from '../../../../server/data/honkai3rd/battlesuits'
|
} from '../../../../../server/data/honkai3rd/battlesuits'
|
||||||
import { useTranslation } from '../../../../lib/i18n'
|
import { useTranslation } from '../../../../../lib/i18n'
|
||||||
import { assetsBucketBaseUrl } from '../../../../lib/consts'
|
import { assetsBucketBaseUrl } from '../../../../../lib/consts'
|
||||||
import { WeaponData } from '../../../../lib/honkai3rd/weapons'
|
import { WeaponData } from '../../../../../lib/honkai3rd/weapons'
|
||||||
import { getWeaponMapByIds } from '../../../../server/data/honkai3rd/weapons'
|
import { getWeaponMapByIds } from '../../../../../server/data/honkai3rd/weapons'
|
||||||
import { StigmataData } from '../../../../lib/honkai3rd/stigmata'
|
import { StigmataData } from '../../../../../lib/honkai3rd/stigmata'
|
||||||
import WeaponCard from '../../../../components/molecules/WeaponCard'
|
import WeaponCard from '../../../../../components/molecules/WeaponCard'
|
||||||
import StigmataCard from '../../../../components/molecules/StigmataCard'
|
import StigmataCard from '../../../../../components/molecules/StigmataCard'
|
||||||
import { getStigmataMapByIds } from '../../../../server/data/honkai3rd/stigmata'
|
import { getStigmataMapByIds } from '../../../../../server/data/honkai3rd/stigmata'
|
||||||
|
|
||||||
type WeaponObjectMap = { [key: string]: WeaponData }
|
type WeaponObjectMap = { [key: string]: WeaponData }
|
||||||
type StigmataObjectMap = { [key: string]: StigmataData }
|
type StigmataObjectMap = { [key: string]: StigmataData }
|
||||||
+8
-8
@@ -1,21 +1,21 @@
|
|||||||
/** @jsxImportSource theme-ui */
|
/** @jsxImportSource theme-ui */
|
||||||
import { NextPageContext } from 'next'
|
import { NextPageContext } from 'next'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PageLink from '../../../../components/atoms/PageLink'
|
import PageLink from '../../../../../components/atoms/PageLink'
|
||||||
import { StigmataSetProps } from '../../../../components/pages/StigmataSetPage'
|
import { StigmataSetProps } from '../../../../../components/pages/StigmataSetPage'
|
||||||
import { generateI18NPaths, getI18NProps } from '../../../../server/i18n'
|
import { generateI18NPaths, getI18NProps } from '../../../../../server/i18n'
|
||||||
import {
|
import {
|
||||||
listStigmata,
|
listStigmata,
|
||||||
getStigmataListBySetId,
|
getStigmataListBySetId,
|
||||||
getStigmataSetBySetId,
|
getStigmataSetBySetId,
|
||||||
listStigmataSet,
|
listStigmataSet,
|
||||||
getStigmaById,
|
getStigmaById,
|
||||||
} from '../../../../server/data/honkai3rd/stigmata'
|
} from '../../../../../server/data/honkai3rd/stigmata'
|
||||||
import { Box, Card, Flex, Heading, Paragraph } from 'theme-ui'
|
import { Box, Card, Flex, Heading, Paragraph } from 'theme-ui'
|
||||||
import SecondaryLabel from '../../../../components/atoms/SecondaryLabel'
|
import SecondaryLabel from '../../../../../components/atoms/SecondaryLabel'
|
||||||
import StigmataCard from '../../../../components/molecules/StigmataCard'
|
import StigmataCard from '../../../../../components/molecules/StigmataCard'
|
||||||
import { useTranslation } from '../../../../lib/i18n'
|
import { useTranslation } from '../../../../../lib/i18n'
|
||||||
import { SingleStigmataPageProps } from '../../../../components/pages/SingleStigmataPage'
|
import { SingleStigmataPageProps } from '../../../../../components/pages/SingleStigmataPage'
|
||||||
|
|
||||||
type StigmataShowPageProps = StigmataSetProps | SingleStigmataPageProps
|
type StigmataShowPageProps = StigmataSetProps | SingleStigmataPageProps
|
||||||
|
|
||||||
+14
-11
@@ -1,21 +1,24 @@
|
|||||||
/** @jsxImportSource theme-ui */
|
/** @jsxImportSource theme-ui */
|
||||||
import { Flex, Box, Card, Heading, Paragraph } from '@theme-ui/components'
|
import { Flex, Box, Card, Heading, Paragraph } from '@theme-ui/components'
|
||||||
import { NextPageContext } from 'next'
|
import { NextPageContext } from 'next'
|
||||||
import SquareImageBox from '../../../../components/atoms/SquareImageBox'
|
import SquareImageBox from '../../../../../components/atoms/SquareImageBox'
|
||||||
import { weaponCategories, WeaponData } from '../../../../lib/honkai3rd/weapons'
|
import {
|
||||||
import { generateI18NPaths, getI18NProps } from '../../../../server/i18n'
|
weaponCategories,
|
||||||
|
WeaponData,
|
||||||
|
} from '../../../../../lib/honkai3rd/weapons'
|
||||||
|
import { generateI18NPaths, getI18NProps } from '../../../../../server/i18n'
|
||||||
import {
|
import {
|
||||||
getWeaponById,
|
getWeaponById,
|
||||||
getWeaponMapByIds,
|
getWeaponMapByIds,
|
||||||
listWeapons,
|
listWeapons,
|
||||||
} from '../../../../server/data/honkai3rd/weapons'
|
} from '../../../../../server/data/honkai3rd/weapons'
|
||||||
import { useTranslation } from '../../../../lib/i18n'
|
import { useTranslation } from '../../../../../lib/i18n'
|
||||||
import PageLink from '../../../../components/atoms/PageLink'
|
import PageLink from '../../../../../components/atoms/PageLink'
|
||||||
import { assetsBucketBaseUrl } from '../../../../lib/consts'
|
import { assetsBucketBaseUrl } from '../../../../../lib/consts'
|
||||||
import { getBattlesuitMapByIds } from '../../../../server/data/honkai3rd/battlesuits'
|
import { getBattlesuitMapByIds } from '../../../../../server/data/honkai3rd/battlesuits'
|
||||||
import { BattlesuitData } from '../../../../lib/honkai3rd/battlesuits'
|
import { BattlesuitData } from '../../../../../lib/honkai3rd/battlesuits'
|
||||||
import BattlesuitCard from '../../../../components/molecules/BattlesuitCard'
|
import BattlesuitCard from '../../../../../components/molecules/BattlesuitCard'
|
||||||
import WeaponCard from '../../../../components/molecules/WeaponCard'
|
import WeaponCard from '../../../../../components/molecules/WeaponCard'
|
||||||
|
|
||||||
interface WeaponShowPageProps {
|
interface WeaponShowPageProps {
|
||||||
weapon: WeaponData
|
weapon: WeaponData
|
||||||
@@ -65,6 +65,7 @@ const VersionShowPage = ({
|
|||||||
return weapon.name
|
return weapon.name
|
||||||
})
|
})
|
||||||
.join(',')}`}
|
.join(',')}`}
|
||||||
|
canonicalHref={`/honkai3rd/versions/${versionData.version}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ const VersionIndexPage = ({ versionDataList }: VersionIndexPageProps) => {
|
|||||||
'common.abyss-lab'
|
'common.abyss-lab'
|
||||||
)}`}
|
)}`}
|
||||||
description={t('versions.list-page-description')}
|
description={t('versions.list-page-description')}
|
||||||
|
canonicalHref={`/honkai3rd/versions`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ const WeaponShowPage = ({
|
|||||||
)} / ${'⭐'.repeat(weapon.rarity)} / ${weaponCategoryName} / ATK : ${
|
)} / ${'⭐'.repeat(weapon.rarity)} / ${weaponCategoryName} / ATK : ${
|
||||||
weapon.atk
|
weapon.atk
|
||||||
} / CRT : ${weapon.crt}`}
|
} / CRT : ${weapon.crt}`}
|
||||||
|
canonicalHref={`/honkai3rd/weapons/${weapon.id}`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ const WeaponListPage = ({ weaponDataList }: WeaponListPageProps) => {
|
|||||||
'common.abyss-lab'
|
'common.abyss-lab'
|
||||||
)}`}
|
)}`}
|
||||||
description={t('weapons-list.description')}
|
description={t('weapons-list.description')}
|
||||||
|
canonicalHref={`/honkai3rd/weapons`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box p={3}>
|
<Box p={3}>
|
||||||
|
|||||||
Reference in New Issue
Block a user