소스 검색

Modify .article-meta and add busuanzi hits

Miles Pong 9 년 전
부모
커밋
e8a5f36fe6
9개의 변경된 파일40개의 추가작업 그리고 11개의 파일을 삭제
  1. 1 0
      languages/en.yml
  2. 1 0
      languages/zh-CN.yml
  3. 3 1
      layout/common/article.ejs
  4. 2 1
      layout/common/footer.ejs
  5. 9 0
      layout/common/post/author.ejs
  6. 10 8
      layout/common/post/date.ejs
  7. 6 0
      layout/common/post/pv.ejs
  8. 5 0
      source/css/custom.styl
  9. 3 1
      source/css/style.styl

+ 1 - 0
languages/en.yml

@@ -22,6 +22,7 @@ article:
     comments: 'Comments'
     share: 'Share'
     catalogue: 'Catalogue'
+    hits: 'Hits'
 profile:
     follow: 'FOLLOW'
     post: 'post'

+ 1 - 0
languages/zh-CN.yml

@@ -22,6 +22,7 @@ article:
     comments: '评论'
     share: '分享到'
     catalogue: '文章目录'
+    hits: '次访问'
 profile:
     follow: '关注我'
     post: '文章'

+ 3 - 1
layout/common/article.ejs

@@ -11,6 +11,8 @@
                     <%- partial('post/date', { class_name: 'article-date', date_format: null }) %>
                     <%- partial('post/category') %>
                     <%- partial('post/tag') %>
+                    <%- partial('post/pv') %>
+                    <%- partial('post/author') %>
                 </div>
             </header>
         <% } %>
@@ -42,4 +44,4 @@
 
 <% if (!index) { %>
     <%- partial('comment/index') %>
-<% } %>
+<% } %>

+ 2 - 1
layout/common/footer.ejs

@@ -5,4 +5,5 @@
             Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>. Theme by <a href="http://github.com/ppoffice">PPOffice</a>
         </div>
     </div>
-</footer>
+</footer>
+<script async="async" src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

+ 9 - 0
layout/common/post/author.ejs

@@ -0,0 +1,9 @@
+<% if (is_post()){ %>
+<div class="article-author"><i class="fa fa-user"></i>
+  <% if (post.author != null) { %>
+  <%= post.author %>
+  <% } else { %>
+  <a href="<%= config.url %>" title="<%= config.author %>"><%= config.author %></a>
+</div>
+  <% } %>
+<% } %>

+ 10 - 8
layout/common/post/date.ejs

@@ -1,8 +1,10 @@
-<% if (post.date) { %>
-    <div class="<%= class_name %>">
-        <i class="fa fa-calendar"></i>
-        <a href="<%- url_for(post.path) %>">
-            <time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
-        </a>
-    </div>
-<% } %>
+<div class="<%= class_name %>">
+  <div class="<%= class_name %>" style="display:inline;">
+    <i class="fa fa-upload" aria-hidden="true"></i>
+    <time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
+  </div>
+  <div style="display:inline;">
+    <i class="fa fa-edit" aria-hidden="true"></i>
+    <time datetime="<%= date_xml(post.updated) %>" itemprop="dateUpdated"><%= date(post.updated, date_format) %></time>
+  </div>
+</div>

+ 6 - 0
layout/common/post/pv.ejs

@@ -0,0 +1,6 @@
+<% if (is_post()){ %>
+<div class="article-category">
+	<i class="fa fa-line-chart"></i>
+	<span id="busuanzi_value_page_pv"><i class="fa fa-spinner fa-spin"></i></span> <%= __('article.hits') %>
+</div>
+<% } %>

+ 5 - 0
source/css/custom.styl

@@ -0,0 +1,5 @@
+.article-meta, .article-meta a
+    color: #9a9ea3;
+    
+.article-meta .article-author
+    float:right

+ 3 - 1
source/css/style.styl

@@ -90,4 +90,6 @@ if sidebar is left
     #main
         float: right
     #profile
-        float: right
+        float: right
+        
+@import "custom"