@@ -2,9 +2,10 @@ import { LeftOutlined, RightOutlined } from '@ant-design/icons';
22import { Breadcrumb } from 'antd' ;
33import cls from 'classnames' ;
44import { NextPage } from 'next' ;
5- import Link from 'next/link' ;
65import { useTranslations } from 'next-intl' ;
7- import React , { useEffect , useMemo } from 'react' ;
6+ import Link from 'next/link' ;
7+ import { useContext , useEffect , useMemo } from 'react' ;
8+ import { Helmet } from 'react-helmet' ;
89
910import { Comment } from '@/components/Comment' ;
1011import { ImageViewer } from '@/components/ImageViewer' ;
@@ -14,6 +15,7 @@ import { Toc } from '@/components/Toc';
1415import { DoubleColumnLayout } from '@/layout/DoubleColumnLayout' ;
1516import { KnowledgeProvider } from '@/providers/knowledge' ;
1617
18+ import { GlobalContext } from '@/context/global' ;
1719import style from './index.module.scss' ;
1820
1921interface IProps {
@@ -28,6 +30,7 @@ const Page: NextPage<IProps> = ({ pId, id, book, chapter }) => {
2830 const chapters = book . children || [ ] ;
2931 const tocs = chapter . toc ? JSON . parse ( chapter . toc ) : [ ] ;
3032 const idx = chapters . findIndex ( ( t ) => t . id === chapter . id ) ;
33+ const { setting } = useContext ( GlobalContext ) ;
3134
3235 const prev = useMemo ( ( ) => {
3336 if ( idx <= 0 ) {
@@ -72,6 +75,9 @@ const Page: NextPage<IProps> = ({ pId, id, book, chapter }) => {
7275 < DoubleColumnLayout
7376 leftNode = {
7477 < >
78+ < Helmet >
79+ < title > { `${ book . title } - ${ t ( 'knowledge' ) } - ${ setting . systemTitle } ` } </ title >
80+ </ Helmet >
7581 < div className = { cls ( style . breadcrump ) } >
7682 < Breadcrumb >
7783 < Breadcrumb . Item >
0 commit comments