diff --git a/src/components/comment.tsx b/src/components/comment.tsx index 1395922e..85d9719c 100644 --- a/src/components/comment.tsx +++ b/src/components/comment.tsx @@ -1,25 +1,11 @@ import { useEffect, useState } from 'react'; import Giscus from '@giscus/react'; -import { graphql, useStaticQuery } from 'gatsby'; + +import useSiteMetadata from '@/hooks/useSiteMetadata'; export default function Comment() { - const { - site: { siteMetadata }, - } = useStaticQuery(graphql` - query { - site { - siteMetadata { - comment { - repo - repoId - category - categoryId - } - } - } - } - `); + const siteMetadata = useSiteMetadata(); const [theme, setTheme] = useState(''); useEffect(() => { diff --git a/src/components/header.tsx b/src/components/header.tsx index 8f41be9c..c24cfe40 100644 --- a/src/components/header.tsx +++ b/src/components/header.tsx @@ -2,16 +2,18 @@ import { MoonIcon, SunIcon } from '@heroicons/react/24/solid'; import { Link } from 'gatsby'; import Menu from '@/components/menu'; +import useSiteMetadata from '@/hooks/useSiteMetadata'; import useTheme from '@/hooks/useTheme'; function Header() { + const siteMetadata = useSiteMetadata(); const [toggleTheme] = useTheme(); const links = ['About', 'Tags']; return (
- Doputer + {siteMetadata.title}