Skip to content

Commit a64dd6d

Browse files
committed
update compatible with ghost>=1.0
update theme style update readme
1 parent 4afaaee commit a64dd6d

File tree

6 files changed

+99
-48
lines changed

6 files changed

+99
-48
lines changed

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
# EverBlog
2-
A three rows layout ghost blog theme
2+
A three-row Ghost blog theme, inspired from Evernote.
33

4-
##Demo:
4+
## Demo:
55
[http://allan.li/](http://allan.li/)
66

7-
##Source:
7+
## Source:
88
https://github.com/lialun/EverBlog
99

10-
##Introduction:
10+
## Introduction:
1111
### Chinese Introduction : [http://allan.li/everblog-theme/](http://allan.li/everblog-theme/)
12-
##Advantage
13-
1. three rows layout,information classification clear and accurate.
14-
2. small themes, load very fast.
15-
3. global ajax request, response fast.
16-
4. dark and light theme change,not dazzling in the night.
17-
5. adaptate mobile phone.
12+
13+
## Advantage
14+
1. Three rows layout,make information classification clear and accurate.
15+
2. Small theme & Global AJAX request.
16+
3. Dark or light theme toggle.
17+
4. Mobile-Friendly.
1818

1919
##Usage:
20-
1. The pic in the top left corner is the Blog Logo, upload in the Admin System-General, default size 70*70px.
21-
2. Navigation list add in the Admin system-Navigation.
22-
You can add Tag URL which can be found in the Admin system-Tags,like "http://allan.li/tag/java/".
23-
You can add Blog URL ,like "http://allan.li/sql-common-resources/".
24-
You can also add external URL ,like "http://google.com/",it will open in new tab.
25-
3. Change Post per page much bigger(like 15),or auto load next page will be fail.
26-
4. The blog which will auto load in the index page, is set in /partials/config.hbs,the default_post param.or leave blank will not auto load blog.
27-
5. Highlight plugin is Prism, support css,js,bash,c,c++,c#,go,php,python,sql,groovy,http.when need highlight,just add \`\`\` and the language name,like \`\`\`java.
20+
1. The pic in the top left corner is the `Publication logo`, upload in the Admin System-`General`, default size 70*70px.
21+
2. Navigation list add in the Admin system-`Design`-`Navigation`.
22+
You can add Tag URL which can be found in the Admin system-Tags, like "http://allan.li/tag/java/".
23+
You can add Blog URL, like "http://allan.li/sql-common-resources/".
24+
You can also add external URL, like "http://google.com/", it will open in new tab.
25+
3. Open mainpage will auto load "/welcome/" blog, if don't have that blog right area will leave blank.You can change the default open blog URL in /partials/config.hbs.
26+
4. Code highlighting plugin is Prism, support supports: css, js, bash, c, c++, c#, go, php, python, sql, groovy, http. To highlight, use markdown code-block (three ticks) and the language name: (```javascript)

assets/css/default.css

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ html {
99
body {
1010
height: 100%;
1111
font-size: 100%;
12-
font-family: "Microsoft YaHei", Arial, Helvetica, sans-serif, "宋体" ! important;
12+
font-family: Helvetica, Tahoma, "Microsoft YaHei", Arial, sans-serif ! important;
1313
}
1414

1515
div, a {
@@ -35,11 +35,6 @@ code {
3535
height: 100%;
3636
}
3737

38-
.octicon {
39-
width: 16px;
40-
height: 16px;
41-
}
42-
4338
.text-overflow {
4439
white-space: nowrap;
4540
text-overflow: ellipsis;
@@ -53,7 +48,8 @@ code {
5348
.list-group-item:first-child, .list-group-item:last-child {
5449
border-radius: 0;
5550
}
56-
/*--------------scroll------------------*/
51+
52+
/*--------------scroll------------------*/
5753
.scroll {
5854
-ms-overflow-style: none;
5955
overflow: -moz-scrollbars-none;
@@ -88,6 +84,7 @@ code {
8884

8985
#navigation {
9086
height: 100%;
87+
font-size: 1.1rem;
9188
}
9289

9390
#logo img {
@@ -134,41 +131,42 @@ code {
134131
}
135132

136133
#blog-list .tag-stats {
137-
height: 5rem;
134+
height: 5.5rem;
138135
list-style-position: inside;
139136
margin: 0;
140-
padding: 7px 12px;
137+
padding: 0.8rem 1rem;
141138
text-align: center;
142139
}
143140

144141
#blog-list .tag-stats-header {
145-
font-size: 1.7rem;
142+
font-size: 1.8rem;
146143
}
147144

148145
#blog-list .tag-stats-count {
149-
font-size: 0.9rem;
146+
font-size: 1rem;
150147
}
151148

152149
#blog-list .blog-excerpt {
153150
cursor: pointer;
154151
list-style-position: inside;
155152
margin: 0;
156-
padding: 7px 12px;
153+
padding: 0.6rem 0.8rem;
157154
}
158155

159156
.blog-excerpt-title {
157+
font-size: 1.0rem;
160158
padding-bottom: 0.1rem;
161159
}
162160

163161
.blog-excerpt-date {
164-
font-size: 0.7rem;
162+
font-size: 0.8rem;
165163
}
166164

167165
.blog-excerpt-content {
168-
font-size: 0.8rem;
166+
font-size: 0.9rem;
169167
font-weight: 400;
170-
line-height: 1.25rem;
171-
height: 3.75rem;
168+
line-height: 1.20rem;
169+
height: 3.60rem;
172170
text-overflow: ellipsis;
173171
overflow: hidden;
174172
}
@@ -223,7 +221,7 @@ code {
223221
}
224222

225223
.blog-view-title {
226-
margin-bottom: 1rem;
224+
margin-bottom: 0.8rem;
227225
text-align: center;
228226
font-size: 2rem;
229227
}
@@ -238,8 +236,50 @@ code {
238236
}
239237

240238
.blog-view-content {
241-
font-size: 0.9rem;
239+
font-size: 1.1rem;
242240
font-weight: 300;
243-
line-height: 1.3rem;
241+
line-height: 1.6rem;
244242
margin-bottom: 3rem;
245243
}
244+
245+
.blog-view-content blockquote {
246+
font-size: 1.1rem;
247+
}
248+
249+
.blog-view-content h1 {
250+
font-size: 2.2rem;
251+
margin-top: 1.4rem;
252+
margin-bottom: 0.8rem;
253+
}
254+
255+
.blog-view-content h2 {
256+
font-size: 1.9rem;
257+
margin-top: 1.2rem;
258+
margin-bottom: 0.8rem;
259+
}
260+
261+
.blog-view-content h3 {
262+
font-size: 1.7rem;
263+
margin-top: 1.1rem;
264+
margin-bottom: 0.5rem;
265+
}
266+
267+
.blog-view-content h4 {
268+
font-size: 1.5rem;
269+
margin-top: 0.9rem;
270+
margin-bottom: 0.3rem;
271+
}
272+
273+
.blog-view-content h6, .blog-view-content h5 {
274+
font-size: 1.2rem;
275+
margin-top: 0.7rem;
276+
margin-bottom: 0.2rem;
277+
}
278+
279+
.blog-view-content .mark, .blog-view-content mark {
280+
padding: 0.1rem;
281+
}
282+
283+
.blog-view-content pre code {
284+
font-size: 0.9rem;
285+
}

assets/js/default.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
}
4141
//load default blog (if url is main page or tag, blog content page will be blank)
4242
if ($("#blog-view").text().trim().length == 0 && default_post != "") {
43-
loadBlogByURL(default_post, false, false);
43+
loadBlogByURL(default_post, false, false, false);
4444
}
4545
//Scroll4Ever
4646
bindScroll4Ever();
@@ -61,7 +61,7 @@ function navigationFunction(obj) {
6161
if (link.match("^(http|https)://" + host + "/tag/.*", "i") || link.match("^(http|https)://" + host + "/?$", "i")) {
6262
loadBlogListByURL(link, true);
6363
} else if (link.match("^(http|https)://" + host + "/.*/$", "i")) {
64-
loadBlogByURL(link, true, true);
64+
loadBlogByURL(link, true, true, true);
6565
} else {
6666
window.open(link, '_self')
6767
}
@@ -76,7 +76,7 @@ function loadBlog(obj) {
7676
$(obj).addClass("active");
7777
//load blog
7878
var url = $(obj).attr("href");
79-
loadBlogByURL(url, true, true);
79+
loadBlogByURL(url, true, true, true);
8080
}
8181

8282
function loadBlogListByURL(url, isSetReplaceState) {
@@ -103,7 +103,7 @@ function loadBlogListByURL(url, isSetReplaceState) {
103103
});
104104
}
105105

106-
function loadBlogByURL(url, isSetReplaceState, isChangeScreen) {
106+
function loadBlogByURL(url, isSetReplaceState, isChangeScreen, isShowAlert) {
107107
$.ajax({
108108
type: "get",
109109
url: url,
@@ -128,7 +128,9 @@ function loadBlogByURL(url, isSetReplaceState, isChangeScreen) {
128128
NProgress.done();
129129
},
130130
error: function () {
131-
alert("Something went wrong!");
131+
if (isShowAlert) {
132+
alert("Something went wrong! please try again later.");
133+
}
132134
}
133135
});
134136
}

default.hbs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<!DOCTYPE html>
2-
<html lang="zh-CN">
2+
<html>
33
<head>
44
<meta charset="UTF-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
66
<title>{{meta_title}}</title>
7-
<meta name="description" content="{{meta_description}}"/>
87
<meta name="HandheldFriendly" content="True"/>
98
<meta name="viewport" content="minimal-ui, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
109
<meta name="apple-mobile-web-app-capable" content="yes"/>

package.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
{
2-
"name": "EverBlog",
3-
"version": "0.2.1"
4-
}
2+
"name": "everblog",
3+
"description": "A three rows layout ghost blog theme",
4+
"version": "0.3.0",
5+
"engines": {
6+
"ghost": ">=1.0.0"
7+
},
8+
"license": "GPL",
9+
"author": {
10+
"email": "[email protected]"
11+
},
12+
"config": {
13+
"posts_per_page": 12
14+
}
15+
}

partials/config.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
var light_theme = "{{asset "css/white.css"}}";//the location of light theme css
55
var dark_theme = "{{asset "css/grey.css"}}";//the location of dark theme css
66
//config
7-
var default_post = "";//the post which show when the blog main page is open.
7+
var default_post = "/welcome/";//the post which show when the blog main page is open.
88
</script>

0 commit comments

Comments
 (0)