2026.10.31:工程与体验优化
- 修复
detail.html中line-height缺冒号、mui-soll拼写错误导致正文行高与滚动失效 - 修复
tags.html中mui-content=append、browser/index.html中autoShwo拼写错误 - 接口返回的 HTML 统一做白名单清洗,防 XSS 注入
- 列表与标签缓存增加 10 分钟过期时间,脏数据不再导致白屏
- 列表首屏去掉 1 秒硬等待,图片启用懒加载并固定缩略图尺寸,避免列表跳动
- 系统分享兼容 iOS(改为
plus.share,Android 保留 Intent 回落) - 清理调试日志、修复隐式全局变量
2017.6.26: 文章列表页增加截图,兼容4.8
2016.10.24: 添加底部菜单栏
2016.10.02: 升级 vue 2.0 版本
2016.05.15:支持代码高亮,支持语言PHP,JS,CSS,Java等,代码格式<pre class="lang:js">code</pre>或<pre class="lang:js"><code>code<code></pre>,代码高亮使用了prismjs,做了一些修改,如有其它需求可修改此插件。
下载本项目代码,打开css/mystyle.css最后几行有注释声明可以修改颜色值,修改颜色值即可自定义主题颜色。
在/js/app.js 中修改 nav_bar 数据可以修改底部菜单栏,其中 class 为图标样式,可选样式参考 所有图标
├── index.html # 主框架页(头部 + 侧滑菜单)
├── list.html # 文章列表(下拉刷新 / 上拉加载)
├── detail.html # 文章详情(代码高亮 / 分享)
├── tags.html # 标签与关键词搜索
├── nav_bar.html # 底部导航
├── browser/index.html # 站外链接内置浏览器
├── js/
│ ├── app.js # 全局配置、组件、请求封装、工具函数
│ ├── mui.min.js # MUI 框架
│ ├── vue.min.js # Vue 2
│ └── prism.js # 代码高亮
├── css/ # mui.min.css / mystyle.css(主题色)/ prism.css
├── fonts/ # mui 图标字体
└── manifest.json # 5+ App 打包配置
无需构建,项目是纯静态页面。用任意静态服务器即可预览(plus.* 相关能力需在 HBuilder 真机运行环境中才可用):
npx serve . # 或 python3 -m http.server 8080界面相关调试请用 HBuilderX 的「运行到手机或模拟器」。
-
安装
wordpress -
为
wordpress安装wordpress rest api(2.0版本及以上) -
更改
/js/app.js里面的name和菜单名称和对应的id(可在example.com/wp-json/wp/v2/categories查看) -
下载安装
Hbuilder,使用其在线打包功能,选择文件/打开目录(打开本项目代码目录),双击manifest.json设置app名称和id,修改app图标和启动图。 -
点击发行,发行为原生应用,设置好开发者证书,然后打包。
打包成功后会自动下载到本地目录,这样一个App就制作好了。
当前主题的functions.php下添加如下代码即可
// 添加缩略图
add_action( 'rest_api_init', 'add_thumbnail_to_JSON' );
function add_thumbnail_to_JSON() {
//Add featured image
register_rest_field( 'post',
'featured_image_src', //NAME OF THE NEW FIELD TO BE ADDED - you can call this anything
array(
'get_callback' => 'get_image_src',
'update_callback' => null,
'schema' => null,
)
);
}
// 自动缩略图
function get_image_src( $object, $field_name, $request ) {
$first_img = '';
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $object['content']['rendered'], $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){
// echo get_bloginfo ( 'stylesheet_directory' );
// echo '/img/default.jpg';
$first_img = 'https://wx2.sinaimg.cn/crop.0.60.600.450.240/bc1249d0gy1fpcnyjbd38j20go0go0ta.jpg';
}
return $first_img;
}我的博客:奋斗的承诺
-
hbuilder:http://www.dcloud.io/
| 打赏 | 加小助手进微信群 |
|---|---|
![]() |
![]() |
##License
The MIT License (MIT)
Copyright (c) 2016 Zhen.Wang
Install the optional test dependency with npm install --no-save --package-lock=false jsdom@26.1.0, then run node tests/sanitize.cjs (Node.js 18+). These DOM tests cover encoded URL protocols and preserved safe links; they do not replace HBuilder/real-device testing or a complete security audit.






