@@ -14,7 +14,7 @@
<% page.categories.forEach(category => { %>
- <%= category.name %>
+ <%= category.name %>
<% }) %>
@@ -28,6 +28,12 @@
<%- page.content %>
+
+
+
<%- partial('valine') %>
diff --git a/layout/common/category-post.ejs b/layout/common/category-post.ejs
index 6f416a1..f13ff9d 100644
--- a/layout/common/category-post.ejs
+++ b/layout/common/category-post.ejs
@@ -1,20 +1,10 @@
-分页页面
-当前分类:<%= page.category %>
+--> <% if (is_category()) { %> --
-
- <% page.posts.forEach(post => { %>
-
-
- 文章标题:<%= post.title %>-建立日期:<%= date(post.date, 'YYYY-MM-DD HH:MM:SS') %>-更新日期:<%= date(post.updated, 'YYYY-MM-DD HH:MM:SS') %>-页面摘要:<%= post.excerpt ? post.excerpt : '无摘要' %>-
- <% }) %>
-
+
+ <%- partial('archive-post') %>
<% } %>
\ No newline at end of file
diff --git a/layout/common/home-post.ejs b/layout/common/home-post.ejs
index 9942ab1..affdad7 100644
--- a/layout/common/home-post.ejs
+++ b/layout/common/home-post.ejs
@@ -1,6 +1,6 @@
-<%- __('category') %>:<%= page.category %> [共<%= page.posts.length %>篇]
+
-
- <% if (!is_archive()) { %>
+
\ No newline at end of file
diff --git a/source/css/blog_basic.css b/source/css/blog_basic.css
deleted file mode 100644
index 65af84e..0000000
--- a/source/css/blog_basic.css
+++ /dev/null
@@ -1,514 +0,0 @@
-.post-content .tip {
- position: relative;
- margin: 2em 0;
- padding: 12px 24px 12px 30px;
- border-left: 4px solid #f66;
- border-top-right-radius: 2px;
- border-bottom-right-radius: 2px;
- background-color: #f8f8f8
-}
-
-.post-content .tip br {
- /**display: none**/
-}
-
-.post-content .tip:before {
- position: absolute;
- top: 14px;
- left: -12px;
- content: "!";
- width: 20px;
- height: 20px;
- border-radius: 100%;
- color: #fff;
- font-size: 14px;
- line-height: 20px;
- font-weight: bold;
- text-align: center;
- background-color: #f66;
- font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif
-}
-
-.content > .post > .post-content > p {
- word-wrap: break-word;
- word-break: break-all;
-}
-
-#ds-thread, #disqus_thread, #cloud-tie-wrapper {
- margin: 0 30px !important
-}
-
-pre {
- font-size: 0.8em !important;
- background-color: #f8f8f8 !important;
- font-family: 'Roboto Mono', 'Lucida Console', 'Trebuchet MS', 'Courier New', Monaco, courier, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Jhenghei', 'Microsoft YaHei', monospace !important
-}
-
-figure.highlight {
- position: relative !important;
- margin: 1em 0 !important;
- border-radius: 2px !important;
- line-height: 1.1em !important;
- background-color: #f8f8f8 !important;
- overflow-x: auto !important
-}
-
-figure.highlight table, figure.highlight tr, figure.highlight td {
- width: 100% !important;
- border-collapse: collapse !important;
- padding: 0 !important;
- margin: 0 !important
-}
-
-figure.highlight .gutter {
- display: none !important
-}
-
-figure.highlight .code pre {
- padding: 1.2em 1.4em !important;
- line-height: 1.5em !important;
- margin: 0 !important
-}
-
-figure.highlight.html .code:after, figure.highlight.js .code:after, figure.highlight.bash .code:after, figure.highlight.css .code:after, figure.highlight.scss .code:after, figure.highlight.diff .code:after, figure.highlight.java .code:after, figure.highlight.xml .code:after, figure.highlight.python .code:after, figure.highlight.json .code:after, figure.highlight.swift .code:after, figure.highlight.ruby .code:after, figure.highlight.perl .code:after, figure.highlight.php .code:after, figure.highlight.c .code:after, figure.highlight.cpp .code:after {
- position: absolute !important;
- top: 0 !important;
- right: 0 !important;
- color: #ccc !important;
- text-align: right !important;
- font-size: 0.75em !important;
- padding: 5px 10px 0 !important;
- line-height: 15px !important;
- height: 15px !important;
- font-weight: 600 !important
-}
-
-figure.highlight.html .code:after {
- content: "HTML"
-}
-
-figure.highlight.js .code:after {
- content: "JS"
-}
-
-figure.highlight.bash .code:after {
- content: "BASH"
-}
-
-figure.highlight.css .code:after {
- content: "CSS"
-}
-
-figure.highlight.scss .code:after {
- content: "SCSS"
-}
-
-figure.highlight.diff .code:after {
- content: "DIFF"
-}
-
-figure.highlight.java .code:after {
- content: "JAVA"
-}
-
-figure.highlight.xml .code:after {
- content: "XML"
-}
-
-figure.highlight.python .code:after {
- content: "PYTHON"
-}
-
-figure.highlight.json .code:after {
- content: "JSON"
-}
-
-figure.highlight.swift .code:after {
- content: "SWIFT"
-}
-
-figure.highlight.ruby .code:after {
- content: "RUBY"
-}
-
-figure.highlight.perl .code:after {
- content: "PERL"
-}
-
-figure.highlight.php .code:after {
- content: "PHP"
-}
-
-figure.highlight.c .code:after {
- content: "C"
-}
-
-figure.highlight.java .code:after {
- content: "JAVA"
-}
-
-figure.highlight.cpp .code:after {
- content: "CPP"
-}
-
-figure.highlight.cpp .code:after {
- content: 'C++'
-}
-
-pre {
- color: #525252 !important
-}
-
-pre .function .keyword, pre .constant {
- color: #0092db !important
-}
-
-pre .keyword, pre .attribute {
- color: #e96900 !important
-}
-
-pre .number, pre .literal {
- color: #ae81ff !important
-}
-
-pre .tag, pre .tag .title, pre .change, pre .winutils, pre .flow, pre .lisp .title, pre .clojure .built_in, pre .nginx .title, pre .tex .special {
- color: #2973b7 !important
-}
-
-pre .symbol, pre .symbol .string, pre .value, pre .regexp {
- color: #42b983 !important
-}
-
-pre .title {
- color: #83B917 !important
-}
-
-pre .tag .value, pre .string, pre .subst, pre .haskell .type, pre .preprocessor, pre .ruby .class .parent, pre .built_in, pre .sql .aggregate, pre .django .template_tag, pre .django .variable, pre .smalltalk .class, pre .javadoc, pre .django .filter .argument, pre .smalltalk .localvars, pre .smalltalk .array, pre .attr_selector, pre .pseudo, pre .addition, pre .stream, pre .envvar, pre .apache .tag, pre .apache .cbracket, pre .tex .command, pre .prompt {
- color: #42b983 !important
-}
-
-pre .comment, pre .java .annotation, pre .python .decorator, pre .template_comment, pre .pi, pre .doctype, pre .shebang, pre .apache .sqbracket, pre .tex .formula {
- color: #b3b3b3 !important
-}
-
-pre .deletion {
- color: #BA4545 !important
-}
-
-pre .coffeescript .javascript, pre .javascript .xml, pre .tex .formula, pre .xml .javascript, pre .xml .vbscript, pre .xml .css, pre .xml .cdata {
- opacity: 0.5 !important
-}
-
-html {
- height: 100%;
- max-height: 100%;
- padding: 0;
- margin: 0;
-}
-
-body {
- padding: 0;
- margin: 0;
- line-height: 1.6em;
-}
-
-.clear {
- clear: both;
- display: block;
- overflow: hidden;
- visibility: hidden;
- width: 0;
- height: 0;
-}
-
-h1, h2, h3, h4, h5, h6 {
- text-rendering: optimizeLegibility;
- line-height: 1;
- margin: 2rem 0;
-}
-
-h1 {
- font-size: 2.1rem;
- line-height: 1.2em;
-}
-
-h2 {
- font-size: 1.9rem;
- line-height: 1.2em;
-}
-
-h3 {
- font-size: 1.75rem;
-}
-
-h4 {
- font-size: 1.3rem;
-}
-
-h5 {
- font-size: 1.3rem;
-}
-
-h6 {
- font-size: 1.3rem;
-}
-
-img {
- max-width: 100%;
- height: auto;
-}
-
-p, ul, ol, dl {
- margin: 1em 0;
-}
-
-ol ol, ul ul, ul ol, ol ul {
- margin: 0.4em 0;
-}
-
-ul p, ol p, li p, .content li p, blockquote p, .content blockquote p,
-.post blockquote p, .post li p {
- margin: 0;
- overflow: visible;
-}
-
-a img {
- border: none;
-}
-
-dl dt {
- float: left;
- width: 180px;
- overflow: hidden;
- clear: left;
- text-align: right;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-weight: bold;
- margin-bottom: 1em;
-}
-
-dl dd {
- margin-left: 200px;
- margin-bottom: 1em;
-}
-
-hr {
- display: block;
- height: 1px;
- border: 0;
- border-top: 1px solid #efefef;
- margin: 3.2em 0;
- padding: 0;
-}
-
-blockquote {
- box-sizing: border-box;
- margin: 1.6em 0 1.6em -2.2em;
- padding: 0 0 0 1.6em;
- border-left: #4a4a4a 0.4em solid;
-}
-
-blockquote p {
- margin: 0.8em 0;
-}
-
-blockquote small {
- display: inline-block;
- margin: 0.8em 0 0.8em 1.5em;
- font-size: 0.9em;
- color: #ccc;
-}
-
-blockquote small:before {
- content: '\2014 \00A0';
-}
-
-blockquote cite {
- font-weight: bold;
-}
-
-blockquote cite a {
- font-weight: normal;
-}
-
-mark {
- background-color: #ffc336;
-}
-
-code, tt {
- padding: 1px 3px;
- font-family: Inconsolata, monospace, sans-serif;
- font-size: 0.85em;
- white-space: pre-wrap;
- border: 1px solid #E3EDF3;
- background: #f7f7f9;
- color: #d14;
- border-radius: 2px;
-}
-
-.toc {
- border: 1px solid #f0f0f0;
- margin-bottom: 20px;
- padding: 10px 30px;
-}
-
-#fb_comments_container {
- overflow: hidden;
- margin: 0 auto;
-}
-
-#fb_comments_container #fb_comments {
- list-style-type: none;
- padding: 0;
-}
-
-#fb_comments_container #fb_comments h1 {
- font-size: 1.3em;
-}
-
-#fb_comments_container #fb_comments h2 {
- font-size: 1.2em;
-}
-
-#fb_comments_container #fb_comments h3 {
- font-size: 1.1em;
-}
-
-#fb_comments_container #fb_comments h4, #fb_comments_container #fb_comments h5,
-#fb_comments_container #fb_comments h6 {
- font-size: 1.05em;
-}
-
-#fb_comments_container #fb_comments .comment {
- position: relative;
- padding: 25px 0;
- border-bottom: 1px solid rgba(150, 150, 150, 0.2);
- *border-bottom: 1px solid #f0f0f0;
-}
-
-#fb_comments_container #fb_comments .comment .avatar {
- position: absolute;
- top: 25px;
- left: 0;
- width: 50px;
- float: left;
-}
-
-#fb_comments_container #fb_comments .comment .avatar img {
- width: 48px;
- border: none;
- border-radius: 5px;
- margin: 0;
-}
-
-#fb_comments_container #fb_comments .comment .comment_body,
-#fb_comments_container #fb_comments .comment .c_content {
- margin-left: 70px;
- display: block;
-}
-
-#fb_comments_container #fb_comments .comment .comment_body p,
-#fb_comments_container #fb_comments .comment .c_content p {
- margin: 5px 0 15px 0;
- padding: 0;
- line-height: 1.8;
-}
-
-#fb_comments_container #fb_comments .comment .comment_body .author,
-#fb_comments_container #fb_comments .comment .c_content .author {
- line-height: 1.5em;
- margin: 0;
- padding: 0;
-}
-
-#fb_comments_container #fb_comments .comment .comment_body .author b,
-#fb_comments_container #fb_comments .comment .c_content .author b {
- color: #555;
-}
-
-#fb_comments_container #fb_comments .comment .comment_body .author small,
-#fb_comments_container #fb_comments .comment .c_content .author small {
- font-weight: normal;
- padding-left: 10px;
- font-size: 0.7em;
- color: #666;
-}
-
-#fb_new_comment {
- padding-bottom: 50px;
-}
-
-#fb_new_comment textarea {
- border-radius: 5px;
- height: 80px;
- width: 98%;
- padding: 5px;
- font-size: 1em;
- border: 1px solid rgba(150, 150, 150, 0.5);
- *border: 1px solid #a8a8a8;
- line-height: 1.5;
-}
-
-#fb_new_comment .comment_error {
- color: red;
- text-align: center;
- display: block;
- font-size: 0.8em;
- padding-top: 1em;
-}
-
-#fb_new_comment .c_button:hover {
- background: #E60900;
- color: #fff;
- text-decoration: none;
-}
-
-#fb_new_comment .c_button, #fb_new_comment #c_submit {
- cursor: pointer;
- font-family: "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
- font-size: 1em;
- line-height: 1.3em;
- letter-spacing: 1px;
- border-radius: 5px;
- padding: 5px 5px 2px 5px;
-}
-
-#fb_new_comment .input_body {
- margin-top: 10px;
-}
-
-#fb_new_comment .input_body ul {
- list-style: none;
- padding: 5px 0;
- margin: auto 0;
-}
-
-#fb_new_comment .input_body ul li {
- float: left;
- margin-right: 2.2%;
- *margin-right: 22px;
-}
-
-#fb_new_comment .input_body ul li label {
- line-height: 1em;
-}
-
-#fb_new_comment .input_body ul li input {
- border-radius: 5px;
- border: 1px solid #ddd;
- padding: 5px;
- background: rgba(255, 255, 255, 0.5);
- margin: 0 0 10px 0;
-}
-
-#SwfStore_farbox_0 {
- height: 0;
- overflow: hidden;
-}
-
-@media screen and (max-width: 320px) {
- #fb_comments .c_content, #fb_comments .comment_body {
- margin-left: 57px;
- }
-}
diff --git a/source/css/common/archive-post.styl b/source/css/common/archive-post.styl
index 77fd3af..c6a7411 100644
--- a/source/css/common/archive-post.styl
+++ b/source/css/common/archive-post.styl
@@ -1,6 +1,4 @@
.archive-container {
- background: #fff
- padding 30px
.archives-wrap {
margin-bottom 20px
diff --git a/source/css/common/article-post.styl b/source/css/common/article-post.styl
index 21a22c1..957291e 100644
--- a/source/css/common/article-post.styl
+++ b/source/css/common/article-post.styl
@@ -1,6 +1,4 @@
-.post {
- background-color: #fff;
- padding: 30px;
+.article-container {
.post-title {
h1 {
@@ -135,4 +133,18 @@
}
+ .post-prev-next {
+
+ margin-bottom 60px
+
+ a.prev {
+ float left
+ }
+
+ a.next {
+ float right
+ }
+
+ }
+
}
diff --git a/source/css/common/category-post.styl b/source/css/common/category-post.styl
new file mode 100644
index 0000000..905b238
--- /dev/null
+++ b/source/css/common/category-post.styl
@@ -0,0 +1,9 @@
+.category-container {
+ .category-name {
+ color: #666
+ font-size 20px
+ font-weight bold
+ margin-bottom 10px
+ }
+
+}
\ No newline at end of file
diff --git a/source/css/common/home-post.styl b/source/css/common/home-post.styl
index db6d3ee..9e951a2 100644
--- a/source/css/common/home-post.styl
+++ b/source/css/common/home-post.styl
@@ -1,7 +1,4 @@
-.article-post {
-
- background: #fff
- padding 30px
+.home-container {
.article-post-list {
diff --git a/source/css/common/tag-post.styl b/source/css/common/tag-post.styl
new file mode 100644
index 0000000..2ab9eb1
--- /dev/null
+++ b/source/css/common/tag-post.styl
@@ -0,0 +1,9 @@
+.tag-container {
+ .tag-name {
+ color: #666
+ font-size 20px
+ font-weight bold
+ margin-bottom 10px
+ }
+
+}
\ No newline at end of file
diff --git a/source/css/right-side.styl b/source/css/right-side.styl
index 053469b..7efd8f7 100644
--- a/source/css/right-side.styl
+++ b/source/css/right-side.styl
@@ -14,5 +14,7 @@ nav-container-height = 60px;
}
.article-post-container {
+ background: #fff
+ padding 30px
}
}
\ No newline at end of file
diff --git a/source/css/style.styl b/source/css/style.styl
index 9a87f30..cb264ee 100644
--- a/source/css/style.styl
+++ b/source/css/style.styl
@@ -9,6 +9,8 @@
@import "common/home-post.styl"
@import "common/archive-post.styl"
@import "common/article-post.styl"
+@import "common/category-post.styl"
+@import "common/tag-post.styl"
@import "common/site-info.styl"
@import "common/paginator.styl"
@import "highlight"
diff --git a/source/js/main.js b/source/js/main.js
index 97621a0..c8a1fa6 100644
--- a/source/js/main.js
+++ b/source/js/main.js
@@ -1,7 +1,7 @@
console.log('this is main.js');
(() => {
// 选择分页器元素里面的 a 标签,但不包含 .page-number,给指定元素追加类 btn 和 设置属性 role=navigation
- document.querySelectorAll('.article-post .paginator a:not(.page-number)').forEach(e => {
+ document.querySelectorAll('.home-container .paginator a:not(.page-number)').forEach(e => {
e.classList.add('btn');
e.setAttribute('role', 'navigation');
});
+
+ <% if (is_home()) { %>
-
<% page.posts.forEach(post => { %>
-
diff --git a/layout/common/tag-post.ejs b/layout/common/tag-post.ejs
index a0c7c9c..37fc26d 100644
--- a/layout/common/tag-post.ejs
+++ b/layout/common/tag-post.ejs
@@ -1,20 +1,10 @@
-
标签页面
-当前标签:<%= page.tag %>
<% if (is_tag()) { %> --
-
- <% page.posts.forEach(post => { %>
-
-
- 文章标题:<%= post.title %>-建立日期:<%= date(post.date, 'YYYY-MM-DD HH:MM:SS') %>-更新日期:<%= date(post.updated, 'YYYY-MM-DD HH:MM:SS') %>-页面摘要:<%= post.excerpt ? post.excerpt : '无摘要' %>-
- <% }) %>
-
++ <%- partial('archive-post') %> <% } %> \ No newline at end of file diff --git a/layout/right-side.ejs b/layout/right-side.ejs index dec30bf..339a745 100644 --- a/layout/right-side.ejs +++ b/layout/right-side.ejs @@ -22,6 +22,10 @@ <% } else if (is_tag()) { %> <%- partial('common/tag-post') %> + + <% } else if (page.title == 'about') { %> + + <%- partial('common/about') %> <% } %><%- __('tag') %>:<%= page.tag %> [共<%= page.posts.length %>篇]+ -
-