Skip to content

Commit 771cd11

Browse files
author
Evan You
committed
blog styles
1 parent 9f291e5 commit 771cd11

File tree

5 files changed

+51
-7
lines changed

5 files changed

+51
-7
lines changed

themes/vue/layout/partials/blog.ejs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
<div class="content blog">
2+
<h1 style="text-align: center; margin-bottom:.5em">The Vue.js Blog</h1>
13
<% site.posts.sort('date', -1).each(function (post) { %>
2-
<div class="content">
3-
<h4><%- post.date.format('MMM D[,] YYYY') %></h3>
4-
<h1><a href="/<%- post.path %>"><%- post.title %></a></h2>
5-
<div><%- post.content %></div>
4+
<div class="post">
5+
<h2><a href="/<%- post.path %>"><%- post.title %></a></h2>
6+
<h4><%- post.date.format('MMM D[,] YYYY') %></h4>
7+
<div><%- post.excerpt %></div>
8+
<a href="/<%- post.path %>">... continue reading</a>
69
</div>
7-
<% }) %>
10+
<% }) %>
11+
</div>

themes/vue/layout/partials/header.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<li><a href="/api/" class="nav-link<%- page.path.match(/api/) ? ' current' : '' %>">API Reference</a></li>
99
<br class="break" />
1010
<li><a href="/examples/" class="nav-link<%- page.path.match(/examples/) ? ' current' : '' %>">Examples</a></li>
11-
<li><a href="/blog/" class="nav-link<%- page.path.match(/blog/) ? ' current' : '' %>">Blog</a></li>
11+
<li><a href="/blog/" class="nav-link<%- (page.path.match(/blog/) || is_post()) ? ' current' : '' %>">Blog</a></li>
1212
<li><a href="https://github.com/yyx990803/vue" target="_blank" class="nav-link">GitHub</a></li>
1313
</ul>
1414
</div>

themes/vue/layout/post.ejs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
<div class="content">
1+
<div class="sidebar blog">
2+
<div class="toggle">···</div>
3+
<div class="list">
4+
<h2>Recent Posts</h2>
5+
<ul>
6+
<% site.posts.sort('date', -1).limit(10).each(function (post) { %>
7+
<li>
8+
<a href="/<%- post.path %>" class="sidebar-link"><%- post.title %></a>
9+
</li>
10+
<% }) %>
11+
</ul>
12+
</div>
13+
</div>
14+
<div class="content blog">
215
<h1><%- page.title %></h1>
16+
<h4><%- page.date.format('MMM D[,] YYYY') %></h4>
317
<%- page.content %>
418
</div>

themes/vue/source/css/_blog.styl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.content.blog
2+
h1
3+
margin 0 0 .5em
4+
h2
5+
margin .8em 0
6+
padding-bottom 0
7+
border-bottom none
8+
a
9+
color $dark
10+
&:hover
11+
border-bottom 2px solid $green
12+
h4
13+
color $light
14+
margin 1.2em 0
15+
figure, p
16+
margin-left 0
17+
.post
18+
padding 1em 0 2em
19+
border-bottom 1px solid $border
20+
21+
@media screen and (max-width: 1400px) and (min-width: 720px)
22+
.content.blog
23+
margin 0 0 0 280px

themes/vue/source/css/page.styl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import "_common"
22
@import "_demo"
3+
@import "_blog"
34

45
$header-height = 40px
56

@@ -63,6 +64,8 @@ $header-height = 40px
6364
&.current
6465
font-weight 600
6566
color $green
67+
&:hover
68+
border-bottom 2px solid $green
6669

6770
.content
6871
padding 2.2em 0

0 commit comments

Comments
 (0)