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