SEO优化
This commit is contained in:
tangly1024
2021-12-06 17:29:38 +08:00
parent 23f143bdd8
commit 2cd75f3e34
11 changed files with 22 additions and 23 deletions

View File

@@ -30,9 +30,9 @@ const BlogPostCard = ({ post, tags }) => {
</div>
<Link href={`${BLOG.path}/article/${post.slug}`} passHref>
<div className='cursor-pointer my-3 text-lg leading-tight font-bold text-black dark:text-gray-100 hover:underline'>
<p className='cursor-pointer my-3 text-lg leading-tight font-bold text-black dark:text-gray-100 hover:underline'>
{post.title}
</div>
</p>
</Link>
<p className='mt-2 text-gray-400 dark:text-gray-400 text-sm'>{post.summary}</p>

View File

@@ -5,21 +5,18 @@ import Router from 'next/router'
const InfoCard = () => {
return <>
<div className='flex justify-center text-center'>
<div className='pb-6 mx-auto leading-8'>
<div className='hover:rotate-45 hover:scale-125 transform duration-200 cursor-pointer' onClick={ () => { Router.push('/') }}>
<div className='flex text-center pb-3 pl-4 cursor-pointer'>
<div className='hover:rotate-45 hover:scale-125 transform duration-200' onClick={ () => { Router.push('/') }}>
<Image
alt={BLOG.author}
width={100}
height={100}
alt={BLOG.title}
width={60}
height={60}
loading='lazy'
src='/avatar.svg'
className='rounded-full border-black'
/>
</div>
<h1 className='text-2xl dark:text-white py-2'>{BLOG.author}</h1>
<h2 className='text-sm text-gray-500 dark:text-gray-400'>{BLOG.description}</h2>
</div>
<div className='text-3xl dark:text-white ml-5 py-3 hover:scale-105 transform duration-200'>{BLOG.title}</div>
</div>
</>
}

View File

@@ -86,7 +86,7 @@ const Header = ({ navBarTitle, fullWidth = true }) => {
<FontAwesomeIcon icon={faBars} className='hover:scale-125 transform duration-200' />
</div>
<Image
alt={BLOG.author}
alt={BLOG.title}
width={28}
height={28}
src='/avatar.svg'

View File

@@ -38,7 +38,7 @@ const RecommendPosts = ({ currentPost, totalPosts }) => {
const { locale } = useGlobal()
return <div className='dark:text-gray-300 dark:bg-gray-800 bg-gray-100 p-2 my-2 border-l-4 border-yellow-500'>
<h2 className='mb-2 font-bold text-xl'>{locale.COMMON.RELATE_POSTS}</h2>
<div className='mb-2 font-bold text-xl'>{locale.COMMON.RELATE_POSTS}</div>
<ul className='list-disc px-5 text-sm '>
{filteredPosts.map(post => (
<li className='py-1' key={post.id} ><Link href={`/article/${post.slug}`}><a className='cursor-pointer hover:underline'>{post.title}</a></Link></li>

View File

@@ -25,7 +25,7 @@ import { faAngleDoubleRight, faArchive, faTags, faThList } from '@fortawesome/fr
*/
const SideBar = ({ tags, currentTag, post, posts, categories, currentCategory, currentSearch }) => {
const { locale } = useGlobal()
return <aside id='sidebar' className='pt-10 bg-white dark:bg-gray-900 w-72 z-10 dark:border-gray-500 border-gray-200 scroll-hidden h-full'>
return <aside id='sidebar' className='pt-5 bg-white dark:bg-gray-900 w-72 z-10 dark:border-gray-500 border-gray-200 scroll-hidden h-full'>
<InfoCard />
<div className={(!post ? 'sticky top-0' : '') + ' bg-white dark:bg-gray-900 pb-4'}>

View File

@@ -29,7 +29,7 @@ const TopNav = ({ tags, currentTag, post, posts, currentSearch, categories, curr
<div className='w-96'>
<Link href='/' passHref>
<div className='cursor-pointer'>
<span className='text-lg dark:text-gray-200'>{BLOG.title}</span> | <span className='dark:text-gray-300'>{BLOG.description}</span>
<h1 className='text-lg dark:text-gray-200 whitespace-nowrap overflow-x-hidden'>{BLOG.title }</h1>
</div>
</Link>
</div>