Browse Source

Optimizing

Fechin 8 years ago
parent
commit
e17cc71fa9
3 changed files with 7 additions and 5 deletions
  1. 2 2
      layout/_partial/post/item.ejs
  2. 2 1
      layout/_partial/screen.ejs
  3. 3 2
      source/css/diaspora.css

+ 2 - 2
layout/_partial/post/item.ejs

@@ -5,6 +5,6 @@
     <div class="else">
         <p><%- post.date.locale("zh-cn").format("MMMM DD, YYYY") %></p>
         <h3><%- link_to(url_for(post.path), post.title || "Untitled", {class: "posttitle"}) %></h3>
-        <p><%- truncate(strip_html(post.content), {length: 120, omission: '...'}) %></p>
+        <p><%- truncate(strip_html(post.content), {length: 80, omission: '...'}) %></p>
     </div>
-</div>
+</div>

+ 2 - 1
layout/_partial/screen.ejs

@@ -21,6 +21,7 @@
     <div id="post0">
         <p><%- first.date.locale("zh-cn").format("MMMM DD, YYYY") %></p>
         <h2><%- link_to(url_for(first.path), first.title || config.title, {class: "posttitle"}) %></h2>
+        <p class="summary"><%- truncate(strip_html(first.content), {length: 60, omission: '...'}) %></p>
     </div>
     <% } %>
-</div>
+</div>

+ 3 - 2
source/css/diaspora.css

@@ -196,10 +196,11 @@ h1.title {font-size:30px;color:#333;line-height:1.3;position:relative;font-weigh
   .relate li div a {font-size:18px;}
   .comment.link {width:140px;padding:5px 0;}
 }
-@media screen and (max-width:480px) {#post0 p:first-child {display:none;}
+@media screen and (max-width:480px) {#post0 p:first-child {display:block;}
   #post0 h2 {text-align:left;margin:0 10px 0 0;}
   #post0 h2 + p {text-align:left;margin:10px 20px 0 0;color:#f2f2f2;font-size:12px;}
   #post0 h2 a {color:#fff;}
+  #post0 .summary {display:none;}
   .relate li {display:none;}
   .relate h3 > em {display:none;}
   .stuff span {margin-right:10px;}
@@ -259,4 +260,4 @@ pre .class,pre .ruby .class .title,pre .css .rules .attribute {color:#99cc99;}
 pre .string,pre .value,pre .inheritance,pre .header,pre .ruby .symbol,pre .xml .cdata {color:#99cc99;}
 pre .css .hexcolor {color:#66cccc;}
 pre .function,pre .python .decorator,pre .python .title,pre .ruby .function .title,pre .ruby .title .keyword,pre .perl .sub,pre .javascript .title,pre .coffeescript .title {color:#6699cc;}
-pre .keyword,pre .javascript .function {color:#cc99cc;}
+pre .keyword,pre .javascript .function {color:#cc99cc;}