Skip to content

Commit 95bee1d

Browse files
committed
add configuration: index banner background
ref #178
1 parent 27a7059 commit 95bee1d

File tree

3 files changed

+64
-40
lines changed

3 files changed

+64
-40
lines changed

_config.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,22 @@ navs:
108108
# ---------------- #
109109
subscribe_rss: /feed.xml
110110

111+
# ---------------- #
112+
# INDEX #
113+
# ---------------- #
114+
index:
115+
banner:
116+
# 首页 banner 区文字颜色
117+
color: "#fff"
118+
# 首页导航栏文字颜色
119+
nav-color: "rgba(255, 255, 255, .5)"
120+
# 首页 banner 区背景颜色
121+
background-color: "#4183c4"
122+
# 首页 banner 区背景图片
123+
# background-image: "/assets/images/octicons-bg.png"
124+
# background-repeat: "no-repeat"
125+
# background-size: "cover"
126+
111127
# ---------------- #
112128
# Jekyll #
113129
# ---------------- #

assets/css/pages/index.css

Lines changed: 0 additions & 39 deletions
This file was deleted.

index.html

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,57 @@
11
---
22
layout: default
33
class: home
4-
css: ['pages/index.css']
54
comments: false
65
---
76

7+
<style>
8+
.home .banner,
9+
.home .site-header,
10+
.home .banner .collection-head,
11+
.home .banner .collection-head a,
12+
.home .site-header h1 a,
13+
.home .site-header .site-header-nav-item:hover {
14+
color: {{ site.index.banner.color | default: '#fff' }};
15+
}
16+
17+
.home .site-header .site-header-nav-item {
18+
color: {{ site.index.banner.nav-color | default: 'rgba(255, 255, 255, .5)' }};
19+
}
20+
21+
.home .banner,
22+
.home .site-header {
23+
background-color: {{ site.index.banner.background-color | default: '#4183c4'}};
24+
}
25+
26+
{% if site.index.banner.background-image %}
27+
.home .banner {
28+
background-image: url("{{ site.index.banner.background-image }}");
29+
background-repeat: {{ site.index.banner.background-repeat | default: 'no-repeat' }};
30+
background-size: {{ site.index.banner.background-size | default: 'cover' }};
31+
}
32+
{% endif %}
33+
34+
.home .banner .collection-head {
35+
background: 0 0;
36+
box-shadow: none;
37+
-webkit-box-shadow: none
38+
}
39+
40+
.home .site-header {
41+
border-bottom: none
42+
}
43+
44+
@media (max-width:50em) {
45+
.home .collapsed .icon-bar {
46+
background-color: white;
47+
}
48+
49+
.home .collection-head .collection-header {
50+
font-size: 1.25em;
51+
}
52+
}
53+
</style>
54+
855
{% assign assets_base_url = site.url %}
956
{% if site.cdn.jsdelivr.enabled %}
1057
{% assign assets_base_url = "https://fastly.jsdelivr.net/gh/" | append: site.repository | append: '@master' %}

0 commit comments

Comments
 (0)