feat: page title.

This commit is contained in:
Ivan Li 2021-07-25 21:52:09 +08:00
parent 0935456906
commit 0934ee746a
2 changed files with 8 additions and 0 deletions

View File

@ -14,12 +14,16 @@ import {
faTimes, faTimes,
} from "@fortawesome/free-solid-svg-icons"; } from "@fortawesome/free-solid-svg-icons";
import clsx from "clsx"; import clsx from "clsx";
import Head from "next/head";
function MyApp({ Component, pageProps }) { function MyApp({ Component, pageProps }) {
const apolloClient = useApollo(pageProps); const apolloClient = useApollo(pageProps);
const [focusOpenSidebar, setFocusOpenSidebar] = useState(false); const [focusOpenSidebar, setFocusOpenSidebar] = useState(false);
return ( return (
<ApolloProvider client={apolloClient}> <ApolloProvider client={apolloClient}>
<Head>
<title>Ivans Blog</title>
</Head>
<ThemeProvider> <ThemeProvider>
<div className={styles.page}> <div className={styles.page}>
<GlobalSidebar <GlobalSidebar

View File

@ -6,6 +6,7 @@ import { ARTICLE } from "../../commons/graphql/queries";
import { Article } from "../../commons/graphql/generated"; import { Article } from "../../commons/graphql/generated";
import { formatRelative } from "date-fns"; import { formatRelative } from "date-fns";
import { zhCN } from "date-fns/locale"; import { zhCN } from "date-fns/locale";
import Head from "next/head";
interface Props { interface Props {
article: Article; article: Article;
} }
@ -17,6 +18,9 @@ const ArticleDetails: FC<Props> = ({ article }) => {
return ( return (
<main className={styles.articleDetails}> <main className={styles.articleDetails}>
<Head>
<title>{article.title} - Ivans Blog - IvanLi.cc</title>
</Head>
<article className={styles.article}> <article className={styles.article}>
<header> <header>
<h1>{article.title}</h1> <h1>{article.title}</h1>