halo 播客 主题更新,
toc 目录自动更新,添加公式渲染
https://github.com/cetr/halo-theme-sagiri/commit/da2d1cf4a4cc13b416c1acc214decd3baaef35bd
https://chatgpt.com/share/6823922c-4e74-800f-941f-1a8145be694c
之前公式渲染的解决方法是在 播客设置中添加 脚本,现在写入了 源代码中
/* .toc > ol > li:before {
content: counter(sectioncounter) ". ";
counter-increment: sectioncounter;
} */
/* 1. 关闭默认列表样式,并在最外层 ol 上初始化计数器 */
.toc ol {
list-style: none;
counter-reset: section;
margin: 0;
padding: 0;
}
/* 2. 每遇到一个 li,就让计数器增加 */
.toc li {
counter-increment: section;
position: relative;
padding-left: 1em; /* 给数字留空间 */
margin: .5em 0;
}
/* 3. 在每个 li 前面插入由 counters() 生成的多级编号 */
.toc li::before {
content: counters(section, ".") ". ";
left: 0;
top: 0;
white-space: nowrap;
/* 如有需要可再加字体与颜色等样式 */
}
add meta apple-mobile-web-app style
这样做的好处是,可以在手机上获得类似 app 的体验,使用浏览器将网页作为app 进行安装,可以获得一个独立的书签,打开后,会隐藏网址导航栏
https://github.com/qyzhizi/halo-theme-sagiri/commit/c41e0eea75854edb80b403f624dff9b612482efb
在 layout/head.ftl 添加了 :
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default"/>