HEXO 主题样式微调

This commit is contained in:
tangly1024
2022-03-21 14:14:13 +08:00
parent 7ba62d0c82
commit 0aaf97e88b
7 changed files with 91 additions and 3 deletions

View File

@@ -0,0 +1,39 @@
import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import CONFIG_HEXO from '../config_hexo'
export default function ArticleCopyright () {
if (!CONFIG_HEXO.ARTICLE_COPYRIGHT) {
return <></>
}
const router = useRouter()
const [path, setPath] = useState(BLOG.LINK + router.asPath)
useEffect(() => {
setPath(window.location.href)
})
const { locale } = useGlobal()
return <section className="dark:text-gray-300 mt-6">
<ul className="overflow-x-auto whitespace-nowrap text-sm dark:bg-gray-700 bg-gray-100 p-5 leading-8 border-l-2 border-blue-500">
<li>
<strong className='mr-2'>{locale.COMMON.AUTHOR}:</strong>
<Link href={'/about'} >
<a className="hover:underline">{BLOG.AUTHOR}</a>
</Link>
</li>
<li>
<strong className='mr-2'>{locale.COMMON.URL}:</strong>
<a className="hover:underline" href={path}>
{path}
</a>
</li>
<li>
<strong className='mr-2'>{locale.COMMON.COPYRIGHT}:</strong>
{locale.COMMON.COPYRIGHT_NOTICE}
</li>
</ul>
</section>
}