切换博客主题 & 阶段性整理原有主题修改

切换博客主题 & 阶段性整理原有主题修改

最后修改于 2022-5-3 ⋅ 共 1.2k 字 ⋅ 3分钟 / #Tutorial / #记录, #博客, #主题

简介:这篇文章主要是为了记录我在切换主题的过程中,所需要做的将部分在旧主题Diary的修改也同步更新到新主题book中。原计划新主题是Learn,所以在前几次commit里写的新主题名称和这次更新以后commit里不一致。
此外,这篇文章还包括了新主题比旧主题多拥有的功能,以及我对比其他博客后准备在新主题中额外添加的功能。

Process NameRecord(Done?)
Switch theme start2021.01.03
Review old changesY
More customize

Changes comparasion in these two themes #

Old changes I made in Diary theme #

File NamePlace (. point to themes/diary/)UsageNeed to add?Done?
PreventSteal.jsIn ./layouts/partial/head.html as <script>Jump back to my site <script src="{{"/vendor/js/creadcss.min.js" | relURL}}" ></script>YesY
.git/./Delete to prevent submodule problemYesY
config.toml<home>add CC BY-NC-SA 4.0--
copyright.html./layouts/partials/MaybeY
tagCloud.htmlIn /layouts/partials/extrabar.htmlNeed to rewriteNo-
404.html./layouts/<a href="/">404</a>--

TODO List in Book theme #

  • 给网站套了个 CDN(按月免费,字体和图片则由 jsdelivr 代理)

  • 标签云,原先以数量显示不够好看,所以换成现在这种。

  • 归档页面

  • 主字体从Roboto改为PingFang SC 苹方和 Monda

  • 支持二维码 qrious

  • Chinese Date Format
    BookDateTimeFormat

  • Find a online CMS article editor for Chinese input-in-browser support (input method in vscode in crostini is broken)
    Using Chrome Offline App (Minimalist Makrdown Editor)

  • Comments support
    Using valine and Leancloud, refer to smslit and kokdemo

  • Usable Img uploader PicGo with plugin picgo-plugin-compress by TinyPNG api to host Github
    注意:因为picgo插件市场是基于npm的,所以内置搜索页因为网络不能使用,需要先手动安装npm,再在picgo配置目录下手动npm install picgo-xxx --registry=ht tps://registry.npm.taobao.org/切换国内源安装。
    最后还是挂了代理解决了插件安装的问题,所以我会留一份单独的配置文件以备下次需要使用(~/.config/picgo/
    手动安装插件还是失败了,最后使用的是github上的imgbot压缩
    另外,picgo设置内还设定了自定义域名(https://cdn.jsdelivr.net/gh/robust-wq/cdn)来利用其他cdn来加速。 测试用图

  • A copy of help pages in Book Demo Site
    Contents are Above

  • Add customized main page, remove robot.txt after completion

Some changes are inspired by Darren’s and TestSmirk and Luzheng’s mate blogs built by wordpress.

  • 添加修改时间git
  • 更换代码块颜色
1
2
3
4
5
6
7
8
# config.toml
[markup.highlight]
  codeFences = true
  guessSyntax = false
  lineNos = true
  lineNumbersInTable = true
  noClasses = true
  style = "tango"
  • 给代码块添加clipboard.js复制功能
  • 文章尾部的: copyright信息 参照1 参照页面
  • 菜单尾部的: bulit by …, powered by … 参照
  • Read count: Valine with Leancloud support
  • Word count pure: single.html & wordcount.html
  • 支持脑图的显示(Kityminder)
    在线绘制导出Markdown格式跟能用的不一样,可以使用的是无序列表,但导出的却是标题,所以绘制功能最后还是删了Mind map support 参考文件
    • Root
      • Level 1
        • Level 2
        • Level 2
          • Level 3
          • Level 3
            • Level 4
              • Level 5
                • Level 6
      • Level 1
        • Level 2
        • Level 2
      • Level 1
        • Level 2
        • Level 2
      • Level 1
        • Level 2
        • Level 2
      • Level 1
        • Level 2
        • Level 2

Some are also good, but just write here not going to add

  • 按照文件夹(比如documents/书本1/)为分类显示多层次目录,实例网站,替代方案:用markdown表示标签的父子顺序(表格?),模板读取该文件生成关系
  • Tag cloud 新主题Book在Section下侧边栏会显示每个分类和所包括文章数,所以不再需要了
  • Add Netlify to auto-generate public/ site
    暂时没必要,现在的方案是

    graph LR; A[--minify]-->|cd ./public/|B[git push
    #submodule x.github.io]-->|cd ..|C[git psuh
    #raw file]

New functionality in Book theme #

Mermaid Online Editor
Meta info for Card-Showing in other share by Open Graph
Buttons
Contribute Columns

Left Content #

Lorem markdownum insigne…

Mid Content #

Lorem markdownum insigne…

Right Content #

Lorem markdownum insigne…

Details
Title

Markdown content #

Lorem markdownum insigne…

Hints
Markdown content
[info|warning|danger]
Katex
\(f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi\) Tabs

MacOS Content #

Linux Content #

Windows Content #