File tree 7 files changed +28
-33
lines changed
7 files changed +28
-33
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,8 @@ <h1>{{ page.title }}</h1>
21
21
</ div >
22
22
{% if page.cover %}
23
23
< div class ="filter "> </ div >
24
- < div class ="post-cover ">
25
- < img id ="postCover " src ="{{ page.cover }} " alt ="">
26
- </ div >
24
+ < div class ="post-cover " style ="background: url('{{ page.cover }}') center no-repeat; background-size: cover; ">
27
25
{% endif %}
28
-
29
26
</ header >
30
27
31
28
< div class ="post-content ">
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ tags: jekyll 前端开发 设计
28
28
29
29
## 新特性
30
30
31
+ ### 主题配色
32
+
33
+ 支持两种主题配色——蓝色和粉色。
34
+
35
+ ![ ] ( https://github.com/kaeyleo/jekyll-theme-H2O/blob/master/assets/img/jekyll-theme-h2o-themecolor.jpg?raw=true )
36
+
31
37
### 侧边栏
32
38
33
39
相比自己上一个版本的博客主题,首页增加侧边栏,可以展示博主简介和推荐标签(默认12个,可以在 ``` _config.yml ``` 文件里的 ``` recommend-condition-size ``` 处修改显示标签的最大个数)。
@@ -90,7 +96,7 @@ tags: jekyll 前端开发 设计
90
96
- Go
91
97
- Python
92
98
93
- ### 评论功能
99
+ ### 第三方评论
94
100
95
101
由于多说关闭,又对国内其他第三方评论插件无感,所以将[Disqus](https://disqus.com/)列为首选(目前模板也只提供了这个),请自备梯子。
96
102
@@ -108,18 +114,14 @@ H2O在这方面还有很多需要完善的地方,比如:<strike>代码高亮
108
114
109
115
### 其他特性:
110
116
111
- - 增加了网页标题SEO优化
112
-
113
- - 支持两种主题颜色蓝色(默认)和粉色,可以在 ```_config.yml``` 文件里的 ```theme-color``` 处根据注释选择配置。主要效果体现在顶部导航栏的logo和鼠标悬停时文字显示的颜色效果。
114
-
115
- - 自定义文章封面
116
-
117
+ - 网页标题SEO优化
117
118
- 标签索引,点击标签跳转到标签目录,即可查看对应的全部文章
118
-
119
- - 支持Disqus评论系统
119
+ - 漂亮
120
+ - 好看
121
+ - 美
120
122
121
123
## 最后
122
124
123
125
本想趁这次机会将整站https化的,但折腾了半天发现弹性web托管并不支持,所以暂时搁置https的想法。另外,博客统计工具一直使用的是[百度统计](https://tongji.baidu.com),这次新增了Google Analytics。
124
126
125
- H2O主题从0到1 ,独自设计、开发再到发布大约用了一周时间,也算完成一个小小的开源项目了,后续也将持续完善和更新。
127
+ 这次从0到1 ,独自设计、开发再到发布大约用了一周时间,也算完成一个小小的开源项目了,后续也将持续完善和更新,欢迎[Star](https://github.com/kaeyleo/jekyll-theme-H2O) 。
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ $(document).ready(function(){
83
83
containerWidth = container . width ( ) ,
84
84
imgHeight = img . height ( ) ,
85
85
containerHeight = container . height ( ) ;
86
-
86
+ var isOk = false ;
87
87
if ( imgHeight < containerHeight ) {
88
88
img . css ( {
89
89
'width' : 'auto' ,
@@ -93,27 +93,26 @@ $(document).ready(function(){
93
93
containerWidth = container . width ( ) ;
94
94
var marginLeft = ( imgWidth - containerWidth ) / 2 ;
95
95
img . css ( 'margin-left' , '-' + marginLeft + 'px' ) ;
96
+ isOk = true ;
96
97
} else {
97
98
var marginTop = ( containerHeight - imgHeight ) / 2 ;
98
99
img . css ( 'margin-top' , marginTop + 'px' ) ;
100
+ isOk = true ;
99
101
}
100
102
101
- setTimeout ( function ( ) {
102
- img . css ( {
103
- 'transition' : '.6s' ,
104
- 'opacity' : '1'
105
- } ) ;
106
- } , 0 ) ;
107
-
103
+ if ( isOk ) {
104
+ img . fadeIn ( ) ;
105
+ isOk = false ;
106
+ }
108
107
}
109
108
110
- postCover ( $ ( '#postCover' ) , $ ( '.g-banner' ) ) ;
111
-
109
+ // 文章分页导航
112
110
$ ( '.read-next-item section' ) . each ( function ( ) {
113
111
var _this = $ ( this ) ,
114
112
n = _this . height ( ) ,
115
113
rn = $ ( '.read-next-item' ) . height ( ) ;
116
114
_this . css ( 'margin-top' , ( rn - n ) / 2 + 'px' ) ;
115
+ _this . fadeIn ( ) ;
117
116
} ) ;
118
117
119
118
$ ( '.read-next-item img' ) . each ( function ( ) {
Original file line number Diff line number Diff line change 481
481
width : 100% ;
482
482
height : 100% ;
483
483
z-index : -2 ; }
484
- .post-header .post-cover img {
485
- opacity : 0 ;
486
- width : 100% ; }
487
484
488
485
.bgcolor-default {
489
486
background-color : # 1494FB ; }
603
600
height : 100% ;
604
601
z-index : 3 ; }
605
602
.read-next-item section {
603
+ display : none;
606
604
position : relative;
607
605
width : 80% ;
608
606
margin-left : 10% ;
628
626
z-index : 1 ;
629
627
transition : .3s linear; }
630
628
.read-next-item img {
629
+ display : none;
631
630
position : absolute;
632
631
top : 0 ;
633
632
left : 0 ;
Original file line number Diff line number Diff line change 383
383
width : 100% ;
384
384
height : 100% ;
385
385
z-index : -2 ;
386
- img {
387
- opacity : 0 ;
388
- width : 100% ;
389
- }
390
386
}
391
387
}
392
388
534
530
z-index : 3 ;
535
531
}
536
532
section {
533
+ display : none ;
537
534
position : relative ;
538
535
width : 80% ;
539
536
margin-left : 10% ;
563
560
transition : .3s linear ;
564
561
}
565
562
img {
563
+ display : none ;
566
564
position : absolute ;
567
565
top : 0 ;
568
566
left : 0 ;
You can’t perform that action at this time.
0 commit comments