Skip to content

Commit

Permalink
update compatible with ghost>=1.0
Browse files Browse the repository at this point in the history
update theme style
update readme
  • Loading branch information
lialun committed Sep 10, 2017
1 parent 4afaaee commit a64dd6d
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 48 deletions.
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
# EverBlog
A three rows layout ghost blog theme
A three-row Ghost blog theme, inspired from Evernote.

##Demo:
## Demo:
[http://allan.li/](http://allan.li/)

##Source:
## Source:
https://github.com/lialun/EverBlog

##Introduction:
## Introduction:
### Chinese Introduction : [http://allan.li/everblog-theme/](http://allan.li/everblog-theme/)
##Advantage
1. three rows layout,information classification clear and accurate.
2. small themes, load very fast.
3. global ajax request, response fast.
4. dark and light theme change,not dazzling in the night.
5. adaptate mobile phone.

## Advantage
1. Three rows layout,make information classification clear and accurate.
2. Small theme & Global AJAX request.
3. Dark or light theme toggle.
4. Mobile-Friendly.

##Usage:
1. The pic in the top left corner is the Blog Logo, upload in the Admin System-General, default size 70*70px.
2. Navigation list add in the Admin system-Navigation.
You can add Tag URL which can be found in the Admin system-Tags,like "http://allan.li/tag/java/".
You can add Blog URL ,like "http://allan.li/sql-common-resources/".
You can also add external URL ,like "http://google.com/",it will open in new tab.
3. Change Post per page much bigger(like 15),or auto load next page will be fail.
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.
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.
1. The pic in the top left corner is the `Publication logo`, upload in the Admin System-`General`, default size 70*70px.
2. Navigation list add in the Admin system-`Design`-`Navigation`.
You can add Tag URL which can be found in the Admin system-Tags, like "http://allan.li/tag/java/".
You can add Blog URL, like "http://allan.li/sql-common-resources/".
You can also add external URL, like "http://google.com/", it will open in new tab.
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.
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)
78 changes: 59 additions & 19 deletions assets/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ html {
body {
height: 100%;
font-size: 100%;
font-family: "Microsoft YaHei", Arial, Helvetica, sans-serif, "宋体" ! important;
font-family: Helvetica, Tahoma, "Microsoft YaHei", Arial, sans-serif ! important;
}

div, a {
Expand All @@ -35,11 +35,6 @@ code {
height: 100%;
}

.octicon {
width: 16px;
height: 16px;
}

.text-overflow {
white-space: nowrap;
text-overflow: ellipsis;
Expand All @@ -53,7 +48,8 @@ code {
.list-group-item:first-child, .list-group-item:last-child {
border-radius: 0;
}
/*--------------scroll------------------*/

/*--------------scroll------------------*/
.scroll {
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
Expand Down Expand Up @@ -88,6 +84,7 @@ code {

#navigation {
height: 100%;
font-size: 1.1rem;
}

#logo img {
Expand Down Expand Up @@ -134,41 +131,42 @@ code {
}

#blog-list .tag-stats {
height: 5rem;
height: 5.5rem;
list-style-position: inside;
margin: 0;
padding: 7px 12px;
padding: 0.8rem 1rem;
text-align: center;
}

#blog-list .tag-stats-header {
font-size: 1.7rem;
font-size: 1.8rem;
}

#blog-list .tag-stats-count {
font-size: 0.9rem;
font-size: 1rem;
}

#blog-list .blog-excerpt {
cursor: pointer;
list-style-position: inside;
margin: 0;
padding: 7px 12px;
padding: 0.6rem 0.8rem;
}

.blog-excerpt-title {
font-size: 1.0rem;
padding-bottom: 0.1rem;
}

.blog-excerpt-date {
font-size: 0.7rem;
font-size: 0.8rem;
}

.blog-excerpt-content {
font-size: 0.8rem;
font-size: 0.9rem;
font-weight: 400;
line-height: 1.25rem;
height: 3.75rem;
line-height: 1.20rem;
height: 3.60rem;
text-overflow: ellipsis;
overflow: hidden;
}
Expand Down Expand Up @@ -223,7 +221,7 @@ code {
}

.blog-view-title {
margin-bottom: 1rem;
margin-bottom: 0.8rem;
text-align: center;
font-size: 2rem;
}
Expand All @@ -238,8 +236,50 @@ code {
}

.blog-view-content {
font-size: 0.9rem;
font-size: 1.1rem;
font-weight: 300;
line-height: 1.3rem;
line-height: 1.6rem;
margin-bottom: 3rem;
}

.blog-view-content blockquote {
font-size: 1.1rem;
}

.blog-view-content h1 {
font-size: 2.2rem;
margin-top: 1.4rem;
margin-bottom: 0.8rem;
}

.blog-view-content h2 {
font-size: 1.9rem;
margin-top: 1.2rem;
margin-bottom: 0.8rem;
}

.blog-view-content h3 {
font-size: 1.7rem;
margin-top: 1.1rem;
margin-bottom: 0.5rem;
}

.blog-view-content h4 {
font-size: 1.5rem;
margin-top: 0.9rem;
margin-bottom: 0.3rem;
}

.blog-view-content h6, .blog-view-content h5 {
font-size: 1.2rem;
margin-top: 0.7rem;
margin-bottom: 0.2rem;
}

.blog-view-content .mark, .blog-view-content mark {
padding: 0.1rem;
}

.blog-view-content pre code {
font-size: 0.9rem;
}
12 changes: 7 additions & 5 deletions assets/js/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
//load default blog (if url is main page or tag, blog content page will be blank)
if ($("#blog-view").text().trim().length == 0 && default_post != "") {
loadBlogByURL(default_post, false, false);
loadBlogByURL(default_post, false, false, false);
}
//Scroll4Ever
bindScroll4Ever();
Expand All @@ -61,7 +61,7 @@ function navigationFunction(obj) {
if (link.match("^(http|https)://" + host + "/tag/.*", "i") || link.match("^(http|https)://" + host + "/?$", "i")) {
loadBlogListByURL(link, true);
} else if (link.match("^(http|https)://" + host + "/.*/$", "i")) {
loadBlogByURL(link, true, true);
loadBlogByURL(link, true, true, true);
} else {
window.open(link, '_self')
}
Expand All @@ -76,7 +76,7 @@ function loadBlog(obj) {
$(obj).addClass("active");
//load blog
var url = $(obj).attr("href");
loadBlogByURL(url, true, true);
loadBlogByURL(url, true, true, true);
}

function loadBlogListByURL(url, isSetReplaceState) {
Expand All @@ -103,7 +103,7 @@ function loadBlogListByURL(url, isSetReplaceState) {
});
}

function loadBlogByURL(url, isSetReplaceState, isChangeScreen) {
function loadBlogByURL(url, isSetReplaceState, isChangeScreen, isShowAlert) {
$.ajax({
type: "get",
url: url,
Expand All @@ -128,7 +128,9 @@ function loadBlogByURL(url, isSetReplaceState, isChangeScreen) {
NProgress.done();
},
error: function () {
alert("Something went wrong!");
if (isShowAlert) {
alert("Something went wrong! please try again later.");
}
}
});
}
Expand Down
3 changes: 1 addition & 2 deletions default.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<!DOCTYPE html>
<html lang="zh-CN">
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>{{meta_title}}</title>
<meta name="description" content="{{meta_description}}"/>
<meta name="HandheldFriendly" content="True"/>
<meta name="viewport" content="minimal-ui, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
Expand Down
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{
"name": "EverBlog",
"version": "0.2.1"
}
"name": "everblog",
"description": "A three rows layout ghost blog theme",
"version": "0.3.0",
"engines": {
"ghost": ">=1.0.0"
},
"license": "GPL",
"author": {
"email": "account@lialun.io"
},
"config": {
"posts_per_page": 12
}
}
2 changes: 1 addition & 1 deletion partials/config.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
var light_theme = "{{asset "css/white.css"}}";//the location of light theme css
var dark_theme = "{{asset "css/grey.css"}}";//the location of dark theme css
//config
var default_post = "";//the post which show when the blog main page is open.
var default_post = "/welcome/";//the post which show when the blog main page is open.
</script>

0 comments on commit a64dd6d

Please sign in to comment.