memos 0.26.2 JSCSS 分享

2026-04-11 14:431阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐
问题描述:

html单页:

这个就不贴源码了,直接打开网页源码复制粘贴

书签导航:https://web.echs.top/links
(利用memos api 读取固定标签的数据,)

简单的动态:https://web.echs.top/memos
(利用memos api 创建简单的近期动态页,并附加artalk评论区)

LXGW WenKai 字体全局覆盖:

/* LXGW WenKai 字体全局覆盖 */ * { font-family: "LXGW WenKai Mono Medium", sans-serif !important; }

// LXGW WenKai 字体全局覆盖 const CSS_URL = 'https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/lxgw-wenkai-web/1.520.0/lxgwwenkaimono-medium/result.min.css'; (function(u){const i='lxgw-global';if(document.getElementById(i))return;const l=document.createElement('link');l.id=i;l.rel='stylesheet';l.crossOrigin='anonymous';l.href=u;document.head.append(l);})(CSS_URL);

Artalk评论区:

// Artalk评论区 const CONFIG = { artalkServer: 'artalk地址', artalkSite: '站点名', artalkJs: 'https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/artalk/2.9.1/Artalk.min.js', artalkCss: 'https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/artalk/2.9.1/Artalk.min.css', box: 'div.pt-8.pb-16.w-full:last-child' // 替换容器 }; (function prefetch(){if(document.getElementById('artalk-js'))return;const link=document.createElement('link');link.rel='stylesheet';link.href=CONFIG.artalkCss;link.crossOrigin='anonymous';document.head.appendChild(link);const script=document.createElement('script');script.id='artalk-js';script.src=CONFIG.artalkJs;script.crossOrigin='anonymous';document.head.appendChild(script);})(); function initArtalk(){const target=document.querySelector(CONFIG.box);if(!target||typeof Artalk==='undefined'||document.querySelector('#artalk'))return;target.style.display='block';target.classList.remove('hidden','invisible');target.innerHTML='<div id="artalk" class="w-full mt-4"></div>';Artalk.init({el:'#artalk',pageKey:'',pageTitle:'',server:CONFIG.artalkServer,site:CONFIG.artalkSite});} let lastPath="";new MutationObserver(()=>{const path=window.location.pathname;if(path.includes('/memos/')&&(path!==lastPath||!document.querySelector('#artalk'))){lastPath=path;setTimeout(initArtalk,500);}}).observe(document.body,{childList:true,subtree:true});

/* 强制评论区显示 */ div.pt-8.pb-16.w-full:last-child { display: block !important; visibility: visible !important; } /* artalk底部标识隐藏 */ .atk-list-footer { display: none !important;} 网友解答:


--【壹】--:

感谢大佬

标签:纯水
问题描述:

html单页:

这个就不贴源码了,直接打开网页源码复制粘贴

书签导航:https://web.echs.top/links
(利用memos api 读取固定标签的数据,)

简单的动态:https://web.echs.top/memos
(利用memos api 创建简单的近期动态页,并附加artalk评论区)

LXGW WenKai 字体全局覆盖:

/* LXGW WenKai 字体全局覆盖 */ * { font-family: "LXGW WenKai Mono Medium", sans-serif !important; }

// LXGW WenKai 字体全局覆盖 const CSS_URL = 'https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/lxgw-wenkai-web/1.520.0/lxgwwenkaimono-medium/result.min.css'; (function(u){const i='lxgw-global';if(document.getElementById(i))return;const l=document.createElement('link');l.id=i;l.rel='stylesheet';l.crossOrigin='anonymous';l.href=u;document.head.append(l);})(CSS_URL);

Artalk评论区:

// Artalk评论区 const CONFIG = { artalkServer: 'artalk地址', artalkSite: '站点名', artalkJs: 'https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/artalk/2.9.1/Artalk.min.js', artalkCss: 'https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/artalk/2.9.1/Artalk.min.css', box: 'div.pt-8.pb-16.w-full:last-child' // 替换容器 }; (function prefetch(){if(document.getElementById('artalk-js'))return;const link=document.createElement('link');link.rel='stylesheet';link.href=CONFIG.artalkCss;link.crossOrigin='anonymous';document.head.appendChild(link);const script=document.createElement('script');script.id='artalk-js';script.src=CONFIG.artalkJs;script.crossOrigin='anonymous';document.head.appendChild(script);})(); function initArtalk(){const target=document.querySelector(CONFIG.box);if(!target||typeof Artalk==='undefined'||document.querySelector('#artalk'))return;target.style.display='block';target.classList.remove('hidden','invisible');target.innerHTML='<div id="artalk" class="w-full mt-4"></div>';Artalk.init({el:'#artalk',pageKey:'',pageTitle:'',server:CONFIG.artalkServer,site:CONFIG.artalkSite});} let lastPath="";new MutationObserver(()=>{const path=window.location.pathname;if(path.includes('/memos/')&&(path!==lastPath||!document.querySelector('#artalk'))){lastPath=path;setTimeout(initArtalk,500);}}).observe(document.body,{childList:true,subtree:true});

/* 强制评论区显示 */ div.pt-8.pb-16.w-full:last-child { display: block !important; visibility: visible !important; } /* artalk底部标识隐藏 */ .atk-list-footer { display: none !important;} 网友解答:


--【壹】--:

感谢大佬

标签:纯水