标签 typecho 中的文章

从typecho迁移到hugo

前几天把博客程序换了, 从typecho换成hugo了, 简单写下使用的插件及遇到的一点坑 使用的插件 使用这个插件,https://github.com/lizheming/typecho-export-hugo, 插件作者写的教程: https://imnerd.org/typecho-plugin-for-hugo-migration.html 遇到的问题 导出失败, 都是一个12.8kb损坏的zip……

阅读全文

CNBATTLE小程序博客上线啦~

基于《让 typecho 支持 JSON 输出》这篇文章把首页,文章页,独立页面做JSon输出,目前文章内图片还不能显示,后续再找解决方法,先上线再说,效果图如下:……

阅读全文

让 typecho 支持 JSON 输出

让 typecho 支持 JSON 输出,做小程序API接口 <?php if (stripos($this->request->getRequestUri(), 'json')) { $arr = array(); while ($this->next()) { $this->categories = $this->categories[0]; $content = htmlspecialchars_decode($this->content); $content = preg_replace( "@<script(.*?)</script>@is", "", $content ); $content = preg_replace( "@<iframe(.*?)</iframe>@is", "", $content ); $content = preg_replace( "@<style(.*?)</style>@is", "", $content ); $this->content = preg_replace( "@<(.*?)>@is", "", $content ); $a = array('title' => $this->title, 'date' => $this->date->format('F j, Y'), 'content' => $this->content, 'url' => $this->permalink, 'categories' => $this->categories, 'tags' => $this->tags); $arr[] = $a; } $num = count($arr); $this->response->throwJson(array("status" => 1,"num" => $num, "data" => $arr)); } ?>……

阅读全文

最近文章

分类

标签

友情链接

其它