Skip to content

Commit 7630766

Browse files
支持小程序
1 parent 0ae6861 commit 7630766

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ _site/
22
.sass-cache/
33
.idea/
44
*.iml
5+
wechat/content/*

Diff for: README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99

1010
本工程实时预览地址 [blogtest.codeboy.me](http://blogtest.codeboy.me)
1111

12+
博客可以简单的搭配微信小程序查看, 具体查看 [https://github.com/androiddevelop/WechatBlog](https://github.com/androiddevelop/WechatBlog)
13+
1214
### 安装方式:
1315

1416
1. 安装jeykll
15-
17+
1618
```
1719
gem install jekyll
1820
gem install jekyll-paginate
1921
```
2022
2. 将CodeboyBlog复制到服务器(部署到github.io的方式自行搜索)。
2123
3. 运行命令生成网站即可(经常改变配置的话不建议增量更新)。
22-
24+
2325
```
2426
jekyll serve --watch &
2527
jekyll serve --watch --incremental & ##增量更新
@@ -32,7 +34,7 @@
3234
cd /path/to/blog
3335
jekyll serve --watch &
3436
```
35-
37+
3638
> ps开头的命令是关闭所有jekyll的进程
3739
>
3840
> cd到网站的根目录
@@ -49,6 +51,10 @@
4951
5052
### 更新内容:
5153
54+
#### 2017-11-17
55+
56+
- 添加初版微信小程序支持,可以便捷创建专属于自己博客的小程序。
57+
5258
#### 2017-04-05
5359
5460
- 调整_config部分配置。

Diff for: wechat/create.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# 创建目录
4+
if [ ! -d content ]
5+
then
6+
mkdir content;
7+
fi
8+
9+
# 生成文件
10+
position=1;
11+
for loop in `ls ../_posts`
12+
do
13+
id=${loop/.md/};
14+
echo "$id $position";
15+
content=`cat template`;
16+
content=${content/cb_page_index/$position}
17+
echo "${content}" > "content/$id"
18+
((position++));
19+
done

Diff for: wechat/template

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: null
3+
---
4+
{% for post in site.posts %}
5+
{% if forloop.rindex == cb_page_index %}
6+
{{ post.content }}
7+
{% endif %}
8+
{% endfor %}

0 commit comments

Comments
 (0)