用 Typora 写 Hexo 博客
Typora 是一个非常优秀的 Markdown 编辑器,与大部分编辑器不同,它使用了一种所及即所得的编辑模式,输入 Markdown 格式的文字,实时渲染。
我用的 Hexo 博客系统,里面的图片路径比较特殊,/images/xx.png
这种路径,一般编辑器是无法识别的,去网上搜了一圈也没找到到底如何在 Typora 中设置,最后在官方文档中找到了。
If you’re using markdown for building websites, you may specify a URL prefix for image preview in local computer with property
typora-root-url
in YAML Front Matters.For example, input
typora-root-url:/User/Abner/Website/typora.io/
in YAML Front Matters, and then
will be treated as
in typora.In new version, instead of manually input
typora-root-url
property, you could just click item from the menu barEdit
→Image Tools
→Use Image Root Path
to tell Typora to generatetypora-root-url
property automatically.
所谓的 YAML 配置,就是在 Hexo 的文档头部加上最下面这一行:
1 |
|
可以在 Typore 的菜单中选择 编辑
→ 图片工具
→ 设置图片根目录
,和手动加那一行的效果是一样的,也会把这个配置写到文档中。