Skip to content

Commit

Permalink
Support for read more
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Jan 2, 2016
1 parent 3b72acb commit 74c38f1
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
19 changes: 19 additions & 0 deletions assets/css/vno.css
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,25 @@ input[type="tel"] {
input[type="tel"]:-ms-input-placeholder {
color: #CCCCCC; }

.read-more {
margin-bottom: 1em; }

.read-more-item {
display: inline;
width: 48%;
margin-top: 20pt;
margin-bottom: 20pt; }

.read-more-item-dim {
color: #7b0f19;
font-size: .8em; }

.read-more-item.read-more-item-left {
float: left; }

.read-more-item.read-more-item-right {
float: right; }

@media all and (max-width: 1100px) {
.panel-cover__logo {
width: 70px; }
Expand Down
27 changes: 27 additions & 0 deletions assets/scss/components/_read-more.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// ------------------------------
// READ MORE
// ------------------------------

.read-more {
margin-bottom: 1em;
}

.read-more-item {
display: inline;
width: 48%;
margin-top: 20pt;
margin-bottom: 20pt;
}

.read-more-item-dim {
color: $hover-color;
font-size: .8em;
}

.read-more-item.read-more-item-left {
float: left;
}

.read-more-item.read-more-item-right {
float: right;
}
1 change: 1 addition & 0 deletions assets/scss/vno.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@import 'components/icons.scss';
@import 'components/post-list.scss';
@import 'components/forms.scss';
@import 'components/read-more.scss';

// ------------------------------
// MEDIA QUERIES
Expand Down
19 changes: 19 additions & 0 deletions partials/read-more.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="read-more">
{{#next_post}}
<div class="read-more-item read-more-item-left">
<span class="read-more-item-dim">最近的文章</span>
<h2 class="post-list__post-title post-title"><a href="{{url}}" title="link to {{{title}}}">{{{title}}}</a></h2>
<p class="excerpt">{{excerpt characters="100"}}&hellip;</p>
<div class="post-list__meta"><time datetime="{{date format="DD MMM YYYY"}}" class="post-list__meta--date date">{{date format="DD MMM YYYY"}}</time> &#8226; <span class="post-list__meta--tags tags">{{tags prefix=""}}</span><a class="btn-border-small" href={{url}}>继续阅读</a></div>
</div>
{{/next_post}}

{{#prev_post}}
<div class="read-more-item read-more-item-right">
<span class="read-more-item-dim">更早的文章</span>
<h2 class="post-list__post-title post-title"><a href="{{url}}" title="link to {{{title}}}">{{{title}}}</a></h2>
<p class="excerpt">{{excerpt characters="100"}}&hellip;</p>
<div class="post-list__meta"><time datetime="{{date format="DD MMM YYYY"}}" class="post-list__meta--date date">{{date format="DD MMM YYYY"}}</time> &#8226; <span class="post-list__meta--tags tags">{{tags prefix=""}}</span><a class="btn-border-small" href={{url}}>继续阅读</a></div>
</div>
{{/prev_post}}
</div>
5 changes: 3 additions & 2 deletions post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
</section>

</article>


{{> read-more}}
{{!-- {{> comments}} --}}

{{/post}}
{{/post}}

0 comments on commit 74c38f1

Please sign in to comment.