添加 SeoPush ✅
This commit is contained in:
parent
33f9f8f0c8
commit
14d4e6e94b
@ -1,5 +1,4 @@
|
||||
---
|
||||
import { Image } from "astro:assets";
|
||||
import { getDescription, fmtTime } from "@/utils/index";
|
||||
const { post } = Astro.props;
|
||||
// 获取文章的摘要
|
||||
@ -13,7 +12,7 @@ import "./ArticleCard.less";
|
||||
|
||||
<article class="vh-article-item vh-animation vh-animation-init">
|
||||
<a class={`vh-article-link${post.data.top ? " active" : ""}`} href={`/article/${post.data.id}`}>
|
||||
<section class="vh-article-banner"><Image src="/assets/images/lazy-loading.webp" data-vh-lz-src={ARTICLE_COVER} alt={post.data.title} width="1" height="1" /></section>
|
||||
<section class="vh-article-banner"><img src="/assets/images/lazy-loading.webp" data-vh-lz-src={ARTICLE_COVER} alt={post.data.title} /></section>
|
||||
<section class="vh-article-desc">
|
||||
<header>
|
||||
<span class={`vh-article-cat vh-cat-${post.data.categories}`}>{post.data.categories}</span>
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
// 静态图片
|
||||
// Svg 组件
|
||||
import Svg from "@/components/Svg/Svg.astro";
|
||||
import { Image } from "astro:assets";
|
||||
// 时间处理
|
||||
import { fmtTime } from "@/utils/index";
|
||||
// 获取用户配置数据
|
||||
@ -30,7 +29,7 @@ import "./Aside.less";
|
||||
{
|
||||
AsideShow.WebSitesShow && (
|
||||
<section class="vh-aside-item user">
|
||||
<Image class="vh-aside-avatar" src="/assets/images/lazy-loading.webp" data-vh-lz-src={Avatar} alt={Author} width="1" height="1" />
|
||||
<img class="vh-aside-avatar" src="/assets/images/lazy-loading.webp" data-vh-lz-src={Avatar} alt={Author} />
|
||||
<span class="vh-aside-auther">{Author}</span>
|
||||
<p class="vh-aside-motto">{Motto}</p>
|
||||
<section class="vh-aside-links">
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
---
|
||||
// 静态图片
|
||||
import { Image } from "astro:assets";
|
||||
// 基础 样式
|
||||
import "./Footer.less";
|
||||
---
|
||||
|
||||
<footer class="vh-footer">
|
||||
<main>
|
||||
<p><Image src="/assets/images/footer/ing.svg" alt="韩小韩" width="1" height="1" /><span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> <path fill="#fff" d="M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM144 221.3c0-33.8 27.4-61.3 61.3-61.3c16.2 0 31.8 6.5 43.3 17.9l7.4 7.4 7.4-7.4c11.5-11.5 27.1-17.9 43.3-17.9c33.8 0 61.3 27.4 61.3 61.3c0 16.2-6.5 31.8-17.9 43.3l-82.7 82.7c-6.2 6.2-16.4 6.2-22.6 0l-82.7-82.7c-11.5-11.5-17.9-27.1-17.9-43.3z"></path></svg><cite>稳定运行</cite><em class="web_time"></em></span><a href="https://analytics.vvhan.com" target="_blank" rel="noopener noreferrer"><Image width="1" height="1" alt="HanAnalytics" src="/assets/images/footer/hananalytics.svg" /></a></p>
|
||||
<p><a href="https://astro.build/" target="_blank" rel="noopener noreferrer"><Image width="1" height="1" alt="Astro" src="/assets/images/footer/astro.svg" /></a><a href="https://github.com/uxiaohan/vhAstro-Theme" target="_blank" rel="noopener noreferrer"><Image width="1" height="1" alt="vhAstro-Theme" src="/assets/images/footer/theme.svg" /></a><a href="/sitemap-index.xml" target="_blank"><Image width="1" height="1" alt="sitemap" src="/assets/images/footer/sitemap.svg" /></a><a href="/rss.xml" target="_blank"><Image width="1" height="1" alt="rss" src="/assets/images/footer/rss.svg" /></a><a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer"><Image width="1" height="1" alt="icp" src="/assets/images/footer/icp.svg" /></a></p>
|
||||
<p><img src="/assets/images/footer/ing.svg" alt="韩小韩" /><span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> <path fill="#fff" d="M269.4 2.9C265.2 1 260.7 0 256 0s-9.2 1-13.4 2.9L54.3 82.8c-22 9.3-38.4 31-38.3 57.2c.5 99.2 41.3 280.7 213.6 363.2c16.7 8 36.1 8 52.8 0C454.7 420.7 495.5 239.2 496 140c.1-26.2-16.3-47.9-38.3-57.2L269.4 2.9zM144 221.3c0-33.8 27.4-61.3 61.3-61.3c16.2 0 31.8 6.5 43.3 17.9l7.4 7.4 7.4-7.4c11.5-11.5 27.1-17.9 43.3-17.9c33.8 0 61.3 27.4 61.3 61.3c0 16.2-6.5 31.8-17.9 43.3l-82.7 82.7c-6.2 6.2-16.4 6.2-22.6 0l-82.7-82.7c-11.5-11.5-17.9-27.1-17.9-43.3z"></path></svg><cite>稳定运行</cite><em class="web_time"></em></span><a href="https://analytics.vvhan.com" target="_blank" rel="noopener noreferrer"><img alt="HanAnalytics" src="/assets/images/footer/hananalytics.svg" /></a></p>
|
||||
<p><a href="https://astro.build/" target="_blank" rel="noopener noreferrer"><img alt="Astro" src="/assets/images/footer/astro.svg" /></a><a href="https://github.com/uxiaohan/vhAstro-Theme" target="_blank" rel="noopener noreferrer"><img alt="vhAstro-Theme" src="/assets/images/footer/theme.svg" /></a><a href="/sitemap-index.xml" target="_blank"><img alt="sitemap" src="/assets/images/footer/sitemap.svg" /></a><a href="/rss.xml" target="_blank"><img alt="rss" src="/assets/images/footer/rss.svg" /></a><a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer"><img alt="icp" src="/assets/images/footer/icp.svg" /></a></p>
|
||||
</main>
|
||||
</footer>
|
||||
|
||||
@ -122,6 +122,12 @@ export default {
|
||||
// 微信收款码
|
||||
WeChat: '/assets/images/wechat.webp'
|
||||
},
|
||||
// 访问网页 自动推送到搜索引擎
|
||||
SeoPush: {
|
||||
enable: false,
|
||||
serverApi: '',
|
||||
paramsName: 'url'
|
||||
},
|
||||
// 页面阻尼滚动速度
|
||||
ScrollSpeed: 666
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
import { $POST } from '@/utils/index'
|
||||
export default async () => {
|
||||
await $POST('https://vh-api.4ce.cn/api/seoPush', { url: window.location.href.replace(/\/$/, '') }, { 'Content-Type': 'application/json; charset=utf-8' })
|
||||
}
|
||||
@ -36,7 +36,7 @@ import GoogleAdInit from "@/scripts/GoogleAd";
|
||||
// Han Analytics 统计
|
||||
import HanAnalyticsInit from "@/scripts/HanAnalytics";
|
||||
// 谷歌 SEO 推送
|
||||
import GoogleSEOInit from "@/scripts/GoogleSeoPush";
|
||||
import SeoPushInit from "@/scripts/SeoPush";
|
||||
// SmoothScroll 滚动优化
|
||||
import SmoothScroll from "@/scripts/Smoothscroll";
|
||||
|
||||
@ -74,7 +74,7 @@ const indexInit = async (only: boolean = true) => {
|
||||
// Google 广告
|
||||
GoogleAdInit();
|
||||
// 谷歌 SEO 推送
|
||||
GoogleSEOInit();
|
||||
SeoPushInit();
|
||||
// 文章评论初始化
|
||||
checkComment() && commentInit(checkComment(), commentLIst)
|
||||
// Han Analytics 统计
|
||||
|
||||
6
src/scripts/SeoPush.ts
Normal file
6
src/scripts/SeoPush.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import SITE_INFO from '@/config'
|
||||
import { $POST } from '@/utils/index'
|
||||
export default async () => {
|
||||
if (!SITE_INFO.SeoPush.enable) return;
|
||||
await $POST(SITE_INFO.SeoPush.serverApi, { [SITE_INFO.SeoPush.paramsName]: window.location.href.replace(/\/$/, '') }, { 'Content-Type': 'application/json; charset=utf-8' })
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user