【jekyll】建站功能-弃用的
🗓 2015年03月15日 📁 文章归类: 建站日志 📝 Edit
版权声明:本文作者是郭飞。转载随意,标明原文链接即可。
原文链接:https://www.guofei.site/2015/03/15/blog_old.html
kramdown-math-katex(弃用)
katex 在本地成功了,
- 是预先解析的,非常方便。
- 切换页码也能解析成功
但在 GitHub Pages 上没成功。
- 原因是 Kramdown 在某个新版本后不支持 Katex
- 解决:借用 MathJax 的解析,然后加载2个js才能解析,且不是预先解析,切换页面时不会解析
- 项目只有7个star呀
- 只能
# _config.yml 上加一句
kramdown:
math_engine: katex
# header 上加一句
<link rel="stylesheet" href="/public/katex/katex.min.css">
# 引入CSS在本地,因此还需要去 Katex 的 GitHub 库下载一下,
# 另外需要下载 fonts 文件夹,放到 katex.min.css 同级
在运行 Jekyll 前需要安装解析器 gem install kramdown-math-katex
我还用了这些,但貌似没太大用:
# GemFile:
gem 'katex'
gem 'kramdown-math-katex'
# _config.yml:
plugins:
- "katex"
- "kramdown-math-katex"
加入404公益(弃用)
在404.html页内插入这个
<script type="text/javascript" src="//qzo【为了防止影响此页面,插入本句】nestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js" charset="utf-8" homePageUrl="http://www.guofei.site" homePageName="回到郭飞的博客"></script>
echarts支持(已下线)
mathJax(弃用)
在header里加入这么一句就可以使用LaTeX了。
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
processEscapes: true
},
TeX: {
equationNumbers: {
autoNumber: ["AMS"],
useLabelIds: true
}
},
"HTML-CSS": {
linebreaks: {
automatic: true
},
scale: 85
},
SVG: {
linebreaks: {
automatic: true
}
}
});
</script>
语法很简单,
Line1是import MathJax这个js包,
Line2是配置MathJax
2017-05-07新加:原mathjex包将被关停,改为以下继续使用:
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
文档见于官网
这时出现一个新问题
问题描述:
点击侧边栏上的按钮,打开一个页面时,LaTeX不能正常渲染。
问题分析:
点击侧边栏时,没有回调MathJax。
问题解决:
在base.js中的函数contentEffects()中插入这么一行代码:
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
timeline(没用下线了)
➡️小事记
向scipy提交代码并被合并 成为scipy1.0.0的121名Author之一 release note ヾ(o◕∀◕)ノ
Journal of Finance and Accounting Volume 3, Issue 6, November 2015, Pages: 177-183
(ง •̀_•́)ง
(ง •̀_•́)ง
ATOM相关配置(不再用 ATOM 了)
快捷键
- 打开设置Settings View: open
- 快捷键
- ctrl+s 保存文件
- ctrl+n 新建文件m
- a 新建
- m 重命名
- ctrl+B 已经打开的文件
编辑
- ctrl+G 然后输入3:6 调转到第3行第七列
- ctrl+R 输入关键词,搜索
- ctrl+shift+R 工程内搜索
- ctrl+L 选中当前行
- ctrl+D 选中所在单词(重复按,选相同单词,可以一起改)
好用的拓展包
minimap
一个package,用于在右上方形成预览
Minimap Titles
干这个的:
██ ██
██ ██
███████
██ ██
██ ██
markdown-preview-enhanced
不错的Markdown可视工具
插入图片
ctrl+shift+I
搜索
教学文档: https://blog.webjeda.com/instant-jekyll-search/
其中,生成的json一定要符合规范,否则无法载入, json验证: https://blog.webjeda.com/instant-jekyll-search/
对于不符合规范的,需要滤掉非法字符:https://shopify.github.io/liquid/filters/replace/
(还有 lunr 也可以添加搜索功能,但是太坑了)
---
---
[
【 for post in site.posts 】
{
"title" : "",
"url" : "",
"category" : "",
"tags" : "",
"date" : "",
"discription" : "",
"content" : ""
} 【% unless forloop.last 】,【 endunless 】
【 endfor 】
]
GitHub Metadata
一个能读取自己GitHub情况的插件:https://jekyll.github.io/github-metadata/
参考学习:https://github.com/ityouknow/ityouknow.github.io
【% assign sorted_repos = (site.github.public_repositories | sort: 'stargazers_count') | reverse | where: "fork", "false" %】
【% for repo in sorted_repos | limit: 8 %】
* 【【 repo.name 】】
【% endfor %】
好用,但是放弃了,用 ./data/data_github.json
来代替。这个文件由 python 生成,用 action 来激活 py 脚本。
您的支持将鼓励我继续创作!
