Skip to content

Commit

Permalink
Merge pull request #546 from TGMPA/feature/blog-list-widget-home
Browse files Browse the repository at this point in the history
Add recent blog posts widget to homepage.
  • Loading branch information
GaryJones committed Mar 21, 2016
2 parents 42ecf00 + 0b61fcd commit 8f0743d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
15 changes: 13 additions & 2 deletions css/style.css
Expand Up @@ -99,7 +99,7 @@ a:hover {
.doc-body h3,
.doc-body h4 {
border-top: 0.2em solid #EEE;
padding-top: 0.5em;
padding-top: 1em;
}

.doc-head,
Expand Down Expand Up @@ -184,6 +184,8 @@ hgroup h2 {
.doc-body-content {
background: #FFF;
border-radius: 1em;
-webkit-box-shadow: 0 0 4px #DDD;
-moz-box-shadow: 0 0 4px #DDD;
box-shadow: 0 0 4px #DDD;
padding: 20px 25px;
position: relative;
Expand Down Expand Up @@ -579,9 +581,17 @@ div#download table {
border: 1px solid #cccccc;
float: right;
font-size: 90%;
margin: 5em 0 3em 1em;
margin: 4.5em 0 3em 1em;
width: 210px;
-webkit-box-shadow: 0 0 4px #DDD;
-moz-box-shadow: 0 0 4px #DDD;
box-shadow: 0 0 4px #DDD;
}

.page-home .recent-posts {
margin-top: 1.5em;
}

.recent-posts h3 {
color: #E73A74;
background-color: #cccccc;
Expand All @@ -595,6 +605,7 @@ div#download table {
.recent-posts ul {
padding: 0 1em 0 2em;
word-wrap: normal;
background-color: #fff;
}
.recent-posts li .post-meta {
font-size: 75%;
Expand Down
2 changes: 1 addition & 1 deletion css/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions index.html
Expand Up @@ -6,6 +6,19 @@
exclude: true
---

<section class="recent-posts">
<h3>Recent posts</h3>
<ul>
{% for post in site.posts | limit: 5 %}
<li>
<a href="{{ post.url | remove: 'index.html' | prepend: site.tgmpa.url }}">{{ post.title }}</a><br />
<span class="post-meta"><a href="{{ post.author | url_escape | prepend: 'https://github.com/' }}">@{{ post.author }}</a> |
<time datetime="{{ post.date | date: "%F %R" }}">{{ post.date | date_to_string }}</time></span>
</li>
{% endfor %}
</ul>
</section>

{% for section in site.homepage %}
<div id="{{ section.anchor }}">
{{ section.content }}
Expand Down

0 comments on commit 8f0743d

Please sign in to comment.