Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
eastonman committed Jul 29, 2018
2 parents fd92ec4 + c4703d3 commit f20fb56
Show file tree
Hide file tree
Showing 128 changed files with 499 additions and 117 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,23 @@ New Material 是一款遵循 Material Design 的 Typecho 主题

- Author 作者:Manyang901
- Original Author 原作者:Viosey
- Version 版本:2.7.0
- Version 版本:2.8.0
- [![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)

## Feature 特性

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

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

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

body {
display: box;
display: -webkit-box;
display: -webkit-flex;
display: flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;

-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
-o-flex-direction: column;
flex-direction: column;
min-height: 100vh;
}

main {
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-box-flex: 1;
-moz-box-flex: 1;
}


Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Typecho functions entry point
*/

define('VERSION', '2.7.0');
define('VERSION', '2.8.0');
require_once('inc/functions/themeOptions.php');
require_once('inc/functions/thumbNail.php');
require_once('inc/functions/extra.php');
Expand Down
67 changes: 36 additions & 31 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ var gulp = require('gulp'),
rename = require('gulp-rename'),
jshint = require('gulp-jshint'),
runSequence = require('run-sequence'),
replace = require('gulp-replace');
replace = require('gulp-replace'),
rev = require("gulp-rev"),
revColletor = require('gulp-rev-collector'),
htmlmin = require('gulp-htmlmin');

//check expression
gulp.task('jshint', function() {
Expand All @@ -22,40 +25,41 @@ gulp.task('minifycss', function() {
.pipe(gulp.dest('./css'));
});

gulp.task('replace-header', function(){
return gulp.src(['./src/php/header.php'])
.pipe(replace('shared.css', 'shared.min.css'))
.pipe(gulp.dest('./inc'));
});

gulp.task('replace-index', function(){
return gulp.src(['./src/php/index.php'])
.pipe(replace('index.css', 'index.min.css'))
.pipe(replace('post.css', 'post.min.css'))
.pipe(gulp.dest('./'));
});

gulp.task('replace-post', function(){
return gulp.src(['./src/php/post.php'])
.pipe(replace('post.css', 'post.min.css'))
.pipe(replace('index.css', 'index.min.css'))
.pipe(gulp.dest('./'));
gulp.task('buildcss', function() {
return gulp.src('./src/css/*.css')
.pipe(minifycss())
.pipe(rev())
.pipe(gulp.dest('./css'))
.pipe(rev.manifest())
.pipe(gulp.dest('./css'));
});

gulp.task('replace-page', function(){
return gulp.src(['./src/php/page.php'])
.pipe(replace('page.css', 'page.min.css'))
.pipe(replace('index.css', 'index.min.css'))
gulp.task('revReplace',function () {
return gulp.src(['css/rev-manifest.json','**/*.php'])
.pipe(revColletor({
replaceReved:true
}))
.pipe(gulp.dest('./'));
});
})

gulp.task('replace-template-links', function(){
return gulp.src(['./src/php/template-links.php'])
.pipe(replace('page.css', 'page.min.css'))
.pipe(replace('index.css', 'index.min.css'))
gulp.task('htmlminify',function () {
return gulp.src(['index.php','page.php', 'post.php', 'template-links.php'])
.pipe(htmlmin({
collapseWhitespace: true,
removeComments: true,
}))
.pipe(gulp.dest('./'));
});
})

gulp.task('htmlminify-inc',function () {
return gulp.src(['inc/header.php', 'inc/footer.php', 'inc/sidebar.php'])
.pipe(htmlmin({
collapseWhitespace: true,
removeComments: true,
ignoreCustomFragments: [/<main>/, /<\/main>/, /<\?[\s\S]*?(?:\?>|$)/]
}))
.pipe(gulp.dest('./inc'));
})
gulp.task('build-clean', function() {
// Return the Promise from del()
return del(['src']);
Expand All @@ -69,8 +73,9 @@ gulp.task('dev-clean', function() {
gulp.task('build', function() {
return runSequence(
'dev-clean',
'minifycss',
['replace-header', 'replace-index','replace-post', 'replace-page', 'replace-template-links'],
'buildcss',
'revReplace',
['htmlminify', 'htmlminify-inc'],
'build-clean');
});

Expand Down
Binary file added img/Avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/Avatar.webp
Binary file not shown.
Binary file added img/Background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/MainPic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/MainPic.webp
Binary file not shown.
82 changes: 82 additions & 0 deletions img/fontcustom/fontcustom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
Icon Font: fontcustom
*/

@font-face {
font-family: "fontcustom";
src: url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.eot");
src: url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.eot?#iefix") format("embedded-opentype"),
url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff2") format("woff2"),
url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.woff") format("woff"),
url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.ttf") format("truetype"),
url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.svg#fontcustom") format("svg");
font-weight: normal;
font-style: normal;
}

@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: "fontcustom";
src: url("./fontcustom_64c4c0ae568da9afcb9e1be056ff0854.svg#fontcustom") format("svg");
}
}

[data-icon]:before { content: attr(data-icon); }

[data-icon]:before,
.icon-cn_bilibili_b:before,
.icon-facebook:before,
.icon-facebook_1:before,
.icon-facebook_4:before,
.icon-facebook_6:before,
.icon-facebook_9:before,
.icon-github:before,
.icon-linkedin:before,
.icon-linkedin_4:before,
.icon-niconico:before,
.icon-post_gplus:before,
.icon-steam:before,
.icon-steam_1:before,
.icon-telegram:before,
.icon-twitter:before,
.icon-twitter_10:before,
.icon-twitter_14:before,
.icon-twitter_15:before,
.icon-youtube:before,
.icon-zhihu_c:before,
.icon-zhihu_px:before {
display: inline-block;
font-family: "fontcustom";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
text-rendering: optimizeLegibility;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
}

.icon-cn_bilibili_b:before { content: "\f100"; }
.icon-facebook:before { content: "\f101"; }
.icon-facebook_1:before { content: "\f102"; }
.icon-facebook_4:before { content: "\f103"; }
.icon-facebook_6:before { content: "\f10c"; }
.icon-facebook_9:before { content: "\f10d"; }
.icon-github:before { content: "\f104"; }
.icon-linkedin:before { content: "\f10e"; }
.icon-linkedin_4:before { content: "\f10f"; }
.icon-niconico:before { content: "\f114"; }
.icon-post_gplus:before { content: "\f105"; }
.icon-steam:before { content: "\f110"; }
.icon-steam_1:before { content: "\f111"; }
.icon-telegram:before { content: "\f106"; }
.icon-twitter:before { content: "\f107"; }
.icon-twitter_10:before { content: "\f108"; }
.icon-twitter_14:before { content: "\f112"; }
.icon-twitter_15:before { content: "\f113"; }
.icon-youtube:before { content: "\f109"; }
.icon-zhihu_c:before { content: "\f10a"; }
.icon-zhihu_px:before { content: "\f10b"; }
Binary file not shown.
Loading

0 comments on commit f20fb56

Please sign in to comment.