From c68e7c90ca206c3f5447ae426cc7411e668762b8 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 21 Nov 2024 12:56:30 +0800 Subject: [PATCH] fix --- lib/sitemap.xml.js | 3 +- themes/magzine/components/RevolverMaps.js | 36 ----------------------- 2 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 themes/magzine/components/RevolverMaps.js diff --git a/lib/sitemap.xml.js b/lib/sitemap.xml.js index fde90c88..c847e57d 100644 --- a/lib/sitemap.xml.js +++ b/lib/sitemap.xml.js @@ -1,3 +1,4 @@ +import BLOG from '@/blog.config' import fs from 'fs' import { siteConfig } from './config' /** @@ -5,7 +6,7 @@ import { siteConfig } from './config' * @param {*} param0 */ export async function generateSitemapXml({ allPages, NOTION_CONFIG }) { - const link = siteConfig('LINK', null, NOTION_CONFIG) + const link = siteConfig('LINK', BLOG.LINK, NOTION_CONFIG) const urls = [ { loc: `${link}`, diff --git a/themes/magzine/components/RevolverMaps.js b/themes/magzine/components/RevolverMaps.js deleted file mode 100644 index a65fc4cf..00000000 --- a/themes/magzine/components/RevolverMaps.js +++ /dev/null @@ -1,36 +0,0 @@ -import { useEffect, useState } from 'react' - -export default function RevolverMaps () { - const [load, changeLoad] = useState(false) - useEffect(() => { - if (!load) { - initRevolverMaps() - changeLoad(true) - } - }) - return
-} - -function initRevolverMaps () { - if (screen.width >= 768) { - Promise.all([ - loadExternalResource('https://rf.revolvermaps.com/0/0/8.js?i=5jnp1havmh9&m=0&c=ff0000&cr1=ffffff&f=arial&l=33') - ]).then(() => { - // console.log('地图加载完成') - }) - } -} - -// 封装异步加载资源的方法 -function loadExternalResource (url) { - return new Promise((resolve, reject) => { - const container = document.getElementById('revolvermaps') - const tag = document.createElement('script') - tag.src = url - if (tag) { - tag.onload = () => resolve(url) - tag.onerror = () => reject(url) - container.appendChild(tag) - } - }) -}