Show newer

本来是在模仿hexo写一个基于fs管理内容的静态博客,后来发现hexo其实是用一个db.json缓存数据的,于是我也做了类似的功能,选择了sqlite,最后写着写着我又想基于sqlite加入动态功能了 :ac_classic24:

看了一下hexo是用md文件的fs路径做key储存数据的,一旦文件名变化,旧的文章将从db.json里删除。

而我目前实现的系统会自动为新识别到的文件创建一个db key,再把db key写回mdx文件上,今后将以这个key来读取本地文件并操作数据库,从而不再依赖文件名做db索引。这样的意义是用户既可以在本地文件系统上直接编写mdx/md文件,也可基于db拓展动态功能,比如统计、留言数据等功能,甚至还可以提供web端的编辑器在网页上编辑mdx/md文件。

这套系统的数据库既可以选择sqlite,并借助github等外部储存服务同步db以直接部署到vercel等serverless服务上;也可以选择pg或mysql以将其转为完全动态的CMS

问一下hexo的front matter上能不能自定义slug?我看文档上有,但是我试了一下好像不行

hexo.io/zh-tw/api/posts.html

RT Evan You
Too many things going on in China in the past few days and I’m too distracted to write any code. It’s complicated - and all I can say is that I hope things get better in a peaceful way.

:sys_twitter: twitter.com/youyuxi/status/159

-1s🕯️
TIME: Breaking News: Former Chinese President Jiang Zemin, who led his country out of isolation after the crushing of pro-democracy protests in Tiananmen Square and supported economic reforms that led to a decade of explosive growth, has died, state TV said
ti.me/3Fdqwkd

:sys_twitter: twitter.com/2hengxin/status/15

王小美 boosted

mastodon现在其实已经内置了一套markdown转换逻辑

i think a better choice for me is to create a new fork and pick only some of the key modification (like markdown) into the new branch and drop some less important features. or the fork will be hard to maintain in the future

感觉这次代码我可能真的合不起来了

Show older
小森林

每个人都有属于自己的一片森林,也许我们从来不曾走过,但它一直在那里,总会在那里。迷失的人迷失了,相逢的人会再相逢。愿这里,成为属于你的小森林。