Skip to content

Commit f20fb56

Browse files
committed
Merge branch 'develop'
2 parents fd92ec4 + c4703d3 commit f20fb56

File tree

128 files changed

+499
-117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+499
-117
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,23 @@ New Material 是一款遵循 Material Design 的 Typecho 主题
3535

3636
- Author 作者:Manyang901
3737
- Original Author 原作者:Viosey
38-
- Version 版本:2.7.0
38+
- Version 版本:2.8.0
3939
- [![Gitter](https://img.shields.io/gitter/room/material-theme/typecho.svg?style=flat-square)](https://gitter.im/material-theme/typecho?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
4040

4141
## Feature 特性
4242

4343
- 遵循Google Material Design标准
4444
- 响应式设计,根据访问设备分辨率的不同显示不同的样式
45+
- 无JQuery,全部采用MDUI内置方法
4546
- Vanilla-Lazyload 首页缩略图“懒加载”
4647
- 全站 PJAX 无刷新技术
48+
- 压缩HTML,CSS 高速加载
4749
- 非插件实现访客数量统计,使用cookies验证,使用自定义字段储存计数器,不修改数据库,高解耦。
48-
- Webp图片优化,根据访问设备是否支持Webp格式的图片返回自适应的图片,节省70%的流量(需要在网站根目录下放置serviceworker.js,详见Install-安装部分)
49-
- ServiceWorker 缓存控制
50-
- PWA 支持(需自行添加manifest.json到网站根目录)
51-
- Update Checker 更新检查(实验性功能,谨慎使用,使用前请慎重考虑!)
50+
- Update Checker 更新检查(实验性功能,谨慎使用!)
5251
- 友链模板
5352

5453
## Compatibility 兼容性
55-
- PHP: 5.2+ ,仅在5.6和7.2上测试,建议使用PHP7.2
54+
- PHP: 5.3+ ,仅在5.6和7.2上测试,建议使用PHP7.2
5655
- Database 数据库: MySQL, Sqlite3, Postgresql(只要有相应的pdo驱动)
5756
- Typecho: 1.0、1.1、1.1测试版(仅在typecho/master 分支上测试)
5857
- Browser Compatibility 浏览器兼容性: Chrome Desktop 49+ , Firefox 60+ , Safari 11.1+ , Chrome Android 67+ , Internet explorer 11(无lazyload无flexbox), Microsoft Edge 17+(无lazyload)
@@ -65,6 +64,7 @@ New Material 是一款遵循 Material Design 的 Typecho 主题
6564

6665
-[Github Release](https://github.com/manyang901/material/releases)页面,点击"material.tar.gz"下载,解压后将文件夹改名为 "Material"(或其他) 后上传到 `/usr/themes`,并启用主题。2.1.0版本引入Travis CI自动压缩css后,不建议直接clone项目,推荐在release界面下载。
6766
- 下载最新文件 然后覆盖原文件即可更新主题, 部分新增加的功能需要到后台开启才会生效 (建议更新后先切换为其他主题, 再切换回该主题)。否则会导致新增设置项空白。
67+
- 修改主题目录权限,使PHP-FPM在目录有写权限,若启用Openbase_dir也需配置允许写入主题目录
6868
- 首页文章概览默认最大输出80个字符, 可手动添加截断符 `<!-- more -->` 控制输出。
6969
- 若要使用Webp自适应图片,需要将解压出文件中serviceworker.js复制到网站的根目录(这是由于serviceworker作用范围的限制和typecho主题结构的特殊性),不使用则所有设备全部返回png格式的图片,注意,现有策略是全部替换请求中的.png为.webp,这意味着若png图没有对应的webp图像则会返回404
7070
- 若需使用PWA,请自行在网站根目录加入manifest.json文件,也可以在线生成

css/shared.css

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,20 +272,27 @@
272272
/* Footer Sticky BEGIN */
273273

274274
body {
275+
display: box;
276+
display: -webkit-box;
275277
display: -webkit-flex;
276-
display: flex;
277-
display: -moz-box;
278+
display: -moz-flex;
278279
display: -ms-flexbox;
280+
display: flex;
281+
282+
-webkit-flex-direction: column;
283+
-moz-flex-direction: column;
284+
-ms-flex-direction: column;
285+
-o-flex-direction: column;
279286
flex-direction: column;
280287
min-height: 100vh;
281288
}
282289

283290
main {
291+
-webkit-box-flex: 1;
292+
-moz-box-flex: 1;
284293
-webkit-flex: 1;
285294
-ms-flex: 1;
286295
flex: 1;
287-
-webkit-box-flex: 1;
288-
-moz-box-flex: 1;
289296
}
290297

291298

functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Typecho functions entry point
44
*/
55

6-
define('VERSION', '2.7.0');
6+
define('VERSION', '2.8.0');
77
require_once('inc/functions/themeOptions.php');
88
require_once('inc/functions/thumbNail.php');
99
require_once('inc/functions/extra.php');

gulpfile.js

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ var gulp = require('gulp'),
55
rename = require('gulp-rename'),
66
jshint = require('gulp-jshint'),
77
runSequence = require('run-sequence'),
8-
replace = require('gulp-replace');
8+
replace = require('gulp-replace'),
9+
rev = require("gulp-rev"),
10+
revColletor = require('gulp-rev-collector'),
11+
htmlmin = require('gulp-htmlmin');
912

1013
//check expression
1114
gulp.task('jshint', function() {
@@ -22,40 +25,41 @@ gulp.task('minifycss', function() {
2225
.pipe(gulp.dest('./css'));
2326
});
2427

25-
gulp.task('replace-header', function(){
26-
return gulp.src(['./src/php/header.php'])
27-
.pipe(replace('shared.css', 'shared.min.css'))
28-
.pipe(gulp.dest('./inc'));
29-
});
30-
31-
gulp.task('replace-index', function(){
32-
return gulp.src(['./src/php/index.php'])
33-
.pipe(replace('index.css', 'index.min.css'))
34-
.pipe(replace('post.css', 'post.min.css'))
35-
.pipe(gulp.dest('./'));
36-
});
37-
38-
gulp.task('replace-post', function(){
39-
return gulp.src(['./src/php/post.php'])
40-
.pipe(replace('post.css', 'post.min.css'))
41-
.pipe(replace('index.css', 'index.min.css'))
42-
.pipe(gulp.dest('./'));
28+
gulp.task('buildcss', function() {
29+
return gulp.src('./src/css/*.css')
30+
.pipe(minifycss())
31+
.pipe(rev())
32+
.pipe(gulp.dest('./css'))
33+
.pipe(rev.manifest())
34+
.pipe(gulp.dest('./css'));
4335
});
4436

45-
gulp.task('replace-page', function(){
46-
return gulp.src(['./src/php/page.php'])
47-
.pipe(replace('page.css', 'page.min.css'))
48-
.pipe(replace('index.css', 'index.min.css'))
37+
gulp.task('revReplace',function () {
38+
return gulp.src(['css/rev-manifest.json','**/*.php'])
39+
.pipe(revColletor({
40+
replaceReved:true
41+
}))
4942
.pipe(gulp.dest('./'));
50-
});
43+
})
5144

52-
gulp.task('replace-template-links', function(){
53-
return gulp.src(['./src/php/template-links.php'])
54-
.pipe(replace('page.css', 'page.min.css'))
55-
.pipe(replace('index.css', 'index.min.css'))
45+
gulp.task('htmlminify',function () {
46+
return gulp.src(['index.php','page.php', 'post.php', 'template-links.php'])
47+
.pipe(htmlmin({
48+
collapseWhitespace: true,
49+
removeComments: true,
50+
}))
5651
.pipe(gulp.dest('./'));
57-
});
52+
})
5853

54+
gulp.task('htmlminify-inc',function () {
55+
return gulp.src(['inc/header.php', 'inc/footer.php', 'inc/sidebar.php'])
56+
.pipe(htmlmin({
57+
collapseWhitespace: true,
58+
removeComments: true,
59+
ignoreCustomFragments: [/<main>/, /<\/main>/, /<\?[\s\S]*?(?:\?>|$)/]
60+
}))
61+
.pipe(gulp.dest('./inc'));
62+
})
5963
gulp.task('build-clean', function() {
6064
// Return the Promise from del()
6165
return del(['src']);
@@ -69,8 +73,9 @@ gulp.task('dev-clean', function() {
6973
gulp.task('build', function() {
7074
return runSequence(
7175
'dev-clean',
72-
'minifycss',
73-
['replace-header', 'replace-index','replace-post', 'replace-page', 'replace-template-links'],
76+
'buildcss',
77+
'revReplace',
78+
['htmlminify', 'htmlminify-inc'],
7479
'build-clean');
7580
});
7681

img/Avatar.jpg

20.1 KB
Loading

img/Avatar.webp

13.4 KB
Binary file not shown.

img/Background.jpg

47.7 KB
Loading

img/MainPic.jpg

40.5 KB
Loading

img/MainPic.webp

25.7 KB
Binary file not shown.

img/fontcustom/fontcustom.css

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
Icon Font: fontcustom
3+
*/
4+
5+
@font-face {
6+
font-family: "fontcustom";
7+
src: url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.eot");
8+
src: url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.eot?#iefix") format("embedded-opentype"),
9+
url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff2") format("woff2"),
10+
url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff") format("woff"),
11+
url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.ttf") format("truetype"),
12+
url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.svg#fontcustom") format("svg");
13+
font-weight: normal;
14+
font-style: normal;
15+
}
16+
17+
@media screen and (-webkit-min-device-pixel-ratio:0) {
18+
@font-face {
19+
font-family: "fontcustom";
20+
src: url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.svg#fontcustom") format("svg");
21+
}
22+
}
23+
24+
[data-icon]:before { content: attr(data-icon); }
25+
26+
[data-icon]:before,
27+
.icon-cn_bilibili_b:before,
28+
.icon-facebook:before,
29+
.icon-facebook_1:before,
30+
.icon-facebook_4:before,
31+
.icon-facebook_6:before,
32+
.icon-facebook_9:before,
33+
.icon-github:before,
34+
.icon-linkedin:before,
35+
.icon-linkedin_4:before,
36+
.icon-niconico:before,
37+
.icon-post_gplus:before,
38+
.icon-steam:before,
39+
.icon-steam_1:before,
40+
.icon-telegram:before,
41+
.icon-twitter:before,
42+
.icon-twitter_10:before,
43+
.icon-twitter_14:before,
44+
.icon-twitter_15:before,
45+
.icon-youtube:before,
46+
.icon-zhihu_c:before,
47+
.icon-zhihu_px:before {
48+
display: inline-block;
49+
font-family: "fontcustom";
50+
font-style: normal;
51+
font-weight: normal;
52+
font-variant: normal;
53+
line-height: 1;
54+
text-decoration: inherit;
55+
text-rendering: optimizeLegibility;
56+
text-transform: none;
57+
-moz-osx-font-smoothing: grayscale;
58+
-webkit-font-smoothing: antialiased;
59+
font-smoothing: antialiased;
60+
}
61+
62+
.icon-cn_bilibili_b:before { content: "\f100"; }
63+
.icon-facebook:before { content: "\f101"; }
64+
.icon-facebook_1:before { content: "\f102"; }
65+
.icon-facebook_4:before { content: "\f103"; }
66+
.icon-facebook_6:before { content: "\f10c"; }
67+
.icon-facebook_9:before { content: "\f10d"; }
68+
.icon-github:before { content: "\f104"; }
69+
.icon-linkedin:before { content: "\f10e"; }
70+
.icon-linkedin_4:before { content: "\f10f"; }
71+
.icon-niconico:before { content: "\f114"; }
72+
.icon-post_gplus:before { content: "\f105"; }
73+
.icon-steam:before { content: "\f110"; }
74+
.icon-steam_1:before { content: "\f111"; }
75+
.icon-telegram:before { content: "\f106"; }
76+
.icon-twitter:before { content: "\f107"; }
77+
.icon-twitter_10:before { content: "\f108"; }
78+
.icon-twitter_14:before { content: "\f112"; }
79+
.icon-twitter_15:before { content: "\f113"; }
80+
.icon-youtube:before { content: "\f109"; }
81+
.icon-zhihu_c:before { content: "\f10a"; }
82+
.icon-zhihu_px:before { content: "\f10b"; }
Binary file not shown.

0 commit comments

Comments
 (0)