秉着将白嫖进行到底的宗旨,决定不再续费 VPS,博客从转移到 Github,使用 Hexo。

第一步:将 Typecho 文章转为 Hexo 文章格式

Hexo 的文章在网站\source\_posts\目录下,Markdown 格式,内容包含了文章标题、发布时间、更新时间、分类、标签、固定连接、文章内容等信息,所以流程就是从 Typecho 数据库中查询出这些数据,拼接成 Hexo 文章的格式,写入.md文件。

查询文章 SQL:

select title,slug,text,created,modified,category,tags from typecho_contents c,(select cid,group_concat(m.name) tags from typecho_metas m,typecho_relationships r where m.mid=r.mid and m.type='tag' group by cid ) t1,(select cid,m.name category from typecho_metas m,typecho_relationships r where m.mid=r.mid and m.type='category') t2 where t1.cid=t2.cid and c.cid=t1.cid

结果入下:
Typecho 数据库

- 阅读剩余部分 -