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

@@ -2,6 +2,7 @@ import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import copy from 'copy-to-clipboard'
import dynamic from 'next/dynamic'
import { useRouter } from 'next/router'
import { useState } from 'react'
import {
@@ -56,7 +57,13 @@ const QrCode = dynamic(() => import('@/components/QrCode'), { ssr: false })
* @param {*} param0
* @returns
*/
const ShareButtons = ({ shareUrl, title, body, image }) => {
const ShareButtons = ({ post }) => {
const router = useRouter()
const shareUrl = siteConfig('LINK') + router.asPath
const title = post.title || siteConfig('TITLE')
const image = post.pageCover
const body = post?.title + ' | ' + title + ' ' + shareUrl + ' ' + post?.summary
const services = siteConfig('POSTS_SHARE_SERVICES').split(',')
const titleWithSiteInfo = title + ' | ' + siteConfig('TITLE')
const { locale } = useGlobal()