fukasawa theme

This commit is contained in:
tangly1024.com
2023-07-04 17:42:09 +08:00
parent c4f4156f7f
commit 900d1c847b
18 changed files with 245 additions and 279 deletions

View File

@@ -1,9 +1,10 @@
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
import React from 'react'
import React, { useEffect } from 'react'
import { useGlobal } from '@/lib/global'
import BLOG from '@/blog.config'
import { useRouter } from 'next/router'
import { getLayoutByTheme } from '@/themes/theme'
import { isBrowser } from '@/lib/utils'
const ArchiveIndex = props => {
const { siteInfo } = props
@@ -12,6 +13,20 @@ const ArchiveIndex = props => {
// 根据页面路径加载不同Layout文件
const Layout = getLayoutByTheme(useRouter())
useEffect(() => {
if (isBrowser()) {
const anchor = window.location.hash
if (anchor) {
setTimeout(() => {
const anchorElement = document.getElementById(anchor.substring(1))
if (anchorElement) {
anchorElement.scrollIntoView({ block: 'start', behavior: 'smooth' })
}
}, 300)
}
}
}, [])
const meta = {
title: `${locale.NAV.ARCHIVE} | ${siteInfo?.title}`,
description: siteInfo?.description,