前言
- 当前主题版本: 1.18.5
- 钟意博客提醒您, 魔改不备份, 亲人两行泪.
文章目录样式
昼夜模式切换
根据分类排版
这是大致思路, 根据自己需求修改
博客目录/_config.yml>inject.script引入1 2 3 4 5 6 7 8 9 10 11 12 13
| const isIndex=()=>{ const href = window.location.href; const protocol = window.location.protocol+"//"+window.location.host+"/"; return href === protocol || href === protocol + "categories/" || href === protocol + "tags/" || href === protocol + "archives/" || href === protocol + "rss/" || href === protocol + "wiki/" || href === protocol + "links/" || href === protocol + "about/"; } if (!isIndex()){ var ThisCategory = document.querySelector("#breadcrumb > a.cap.breadcrumb-link").text; if (ThisCategory == "第九艺术") { document.querySelector("#start > div > article > h1").style.display = 'none'; document.querySelector("#start > div > article > div:nth-child(3)").style.textAlign = 'center'; } }
|
全局复制提示
博客目录/_config.yml1 2 3 4 5
| inject: head: - <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/izitoast@1.4.0/dist/css/iziToast.min.css"> script: - <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/izitoast@1.4.0/dist/js/iziToast.min.js"></script>
|
博客目录/_config.yml>inject.script引入1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| document.body.oncopy = function () { iziToast.info({ timeout: 4000,
closeOnEscape: 'true', transitionIn: 'bounceInLeft', transitionOut: 'fadeOutRight', displayMode: 'replace', layout: '2', position: 'topRight',
iconUrl: 'https://upyun.thatcdn.cn/hexo/stellar/image/favicon.webp', backgroundColor: '#fff', title: '复制成功', message: '请遵守 CC BY-NC-SA 4.0 协议' }); }
|
修改网页字体
博客目录/_config.yml1 2 3
| inject: head: - <link rel="stylesheet" href="https://upyun.thatcdn.cn/hexo/stellar/css/font.css">
|
博客目录/_config.stellar.yml1 2 3 4 5 6 7 8 9 10 11
| style: font-size: root: 19.3px body: .9999rem code: 85% codeblock: 0.8125rem font-family: logo: 'ZFonts, system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif' body: 'ZFonts, system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif' code: 'Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif' codeblock: 'Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif'
|
侧边栏欢迎图
API采用IP签名档, 主要是代码的img标签.
博客目录/source/_data/widgets.yml1 2 3 4 5 6
| welcome: layout: markdown title: '🎉欢迎, 先生亦或是姑娘: ' content: | 这是一个成分复杂的小站,建于二十一世纪初,至今练习时长两年半,将会继续长期维护和更新。<br>🙏本站评论与动态在Github托管, 显示不全是不能裸连Github。 <img id="ZYTheme" style="border-radius: 10px;" src="https://api.szfx.top/info-card/?word=感谢来访钟意博客, 懈怠轻忽."/>
|
自定义Fancybox范围
好在主题已经给出相关配置, 我们只需要找到自己要开启的地方.
我开的地方除了自带image标签还有文章里所有img, 和waline评论里的img.
_config.stellar.yml1 2 3 4 5
| plugins: fancybox: selector: .swiper-slide img, .md-text.content p>img, .md-text.content li img , .wl-content img
|
代码主题样式
博客目录/_config.stellar.yml1 2 3
| style: codeblock: highlightjs_theme: https://upyun.thatcdn.cn/public/web/stellar-1.18.5/ZYCode.css
|
字体切片
cn-font-split
切片方法
新建一个xxx.mjs
文件, 填入以下代码.
切片函数1 2 3 4 5 6 7 8 9
| import { fontSplit } from "@konghayao/cn-font-split";
fontSplit({ FontPath: "./xxx.ttf", destFold: "./FontOrigin", targetType: "ttf", testHTML: true, reporter: true, });
|
使用方法
引入FontOrigin目录里面的css即可, 并把网站字体选成css里面的font-family
测试TimeLIne自定义模板
还在测试…