SEO 优化首屏加载体积

This commit is contained in:
tangly1024.com
2023-12-01 18:38:24 +08:00
parent fc04a01356
commit c20ad9973e
23 changed files with 174 additions and 83 deletions

View File

@@ -4,7 +4,12 @@ import CONFIG from '../config'
import { siteConfig } from '@/lib/config'
import { formatDateFmt } from '@/lib/formatDate'
export const ArticleInfo = (props) => {
/**
* 文章描述
* @param {*} props
* @returns
*/
export default function ArticleInfo (props) {
const { post } = props
const { locale } = useGlobal()

View File

@@ -8,7 +8,7 @@ import { useEffect, useRef } from 'react'
* @param validPassword(bool) 回调函数校验正确回调入参为true
* @returns
*/
export const ArticleLock = props => {
export default function ArticleLock (props) {
const { validPassword } = props
const { locale } = useGlobal()

View File

@@ -6,7 +6,12 @@ import { AdSlot } from '@/components/GoogleAdsense'
import { siteConfig } from '@/lib/config'
import CONFIG from '../config'
export const BlogListPage = props => {
/**
* 博客列表
* @param {*} props
* @returns
*/
export default function BlogListPage(props) {
const { page = 1, posts, postCount } = props
const router = useRouter()
const totalPage = Math.ceil(postCount / parseInt(siteConfig('POSTS_PER_PAGE')))

View File

@@ -4,7 +4,12 @@ import throttle from 'lodash.throttle'
import { BlogItem } from './BlogItem'
import { siteConfig } from '@/lib/config'
export const BlogListScroll = props => {
/**
* 滚动博客列表
* @param {*} props
* @returns
*/
export default function BlogListScroll (props) {
const { posts } = props
const { locale } = useGlobal()

View File

@@ -1,7 +1,12 @@
import DarkModeButton from '@/components/DarkModeButton'
import { siteConfig } from '@/lib/config'
export const Footer = (props) => {
/**
* 页脚
* @param {*} props
* @returns
*/
export default function Footer (props) {
const d = new Date()
const currentYear = d.getFullYear()
const since = siteConfig('SINCE')

View File

@@ -9,7 +9,7 @@ import { compressImage } from '@/lib/notion/mapImage'
* 网站顶部
* @returns
*/
export const Header = (props) => {
export default function Header (props) {
const { siteInfo } = props
const avatar = compressImage(siteInfo?.icon || siteConfig('AVATAR'), 200)

View File

@@ -7,7 +7,7 @@ import { MenuList } from './MenuList'
* @param {*} props
* @returns
*/
export const NavBar = (props) => {
export default function NavBar (props) {
const [showSearchInput, changeShowSearchInput] = useState(false)
const router = useRouter()

View File

@@ -3,7 +3,12 @@ import Live2D from '@/components/Live2D'
import Announcement from './Announcement'
import Catalog from './Catalog'
export const SideBar = (props) => {
/**
* 侧边栏
* @param {*} props
* @returns
*/
export default function SideBar (props) {
const { notice } = props
return (<>

View File

@@ -5,7 +5,7 @@ import { siteConfig } from '@/lib/config'
* 网站顶部 提示栏
* @returns
*/
export const TopBar = (props) => {
export default function TopBar (props) {
const content = siteConfig('SIMPLE_TOP_BAR_CONTENT', null, CONFIG)
if (content) {