• 首页

  • 写作

  • 文章归档

  • 照片

  • 友情链接

  • 旅行

  • 读书

  • 日志

  • 随记

  • 人文历史

  • linux

  • 前端
b l o g
b l o g

admin

lzp

05月
14
前端
css

halo 播客 主题更新, toc 目录自动更新,添加公式渲染

发表于 2025-05-14 • 字数统计 349 • 被 40 人看爆

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"/>    
分享到:
vpn 会禁用 git ssh 22 号端口,开启 443端口
网站分享,适合电脑浏览器打开
  • 文章目录
  • 站点概览
admin

! lzp

hello

Github Twitter QQ Email Telegram RSS
看爆 Top5
  • 历史与人文 视频链接 229次看爆
  • 2022日志随笔 188次看爆
  • 我的青海湖骑行 187次看爆
  • 读书随笔 135次看爆
  • rs2 设置教程 122次看爆

站点已萌萌哒运行 00 天 00 小时 00 分 00 秒(●'◡'●)ノ♥

Copyright © 2025 admin

由 Halo 强力驱动 · Theme by Sagiri · 站点地图