Skip to content

Commit

Permalink
Add Blog and Archive
Browse files Browse the repository at this point in the history
  • Loading branch information
yshalsager committed Jan 26, 2019
1 parent 7e5ad5f commit 6af99d1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _includes/header.html
Expand Up @@ -5,6 +5,7 @@ <h1><a href="/">Xiaomi Firmware Updater</a> by <a href="https://github.com/yshal
<nav id="nav">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/blog/">Blog</a></li>
<li>
<a class="icon fa-angle-down" style="cursor: pointer;">Projects</a>
<ul>
Expand Down Expand Up @@ -40,6 +41,7 @@ <h1><a href="/">Xiaomi Firmware Updater</a> by <a href="https://github.com/yshal
<li><a href="/team/">Our Team</a></li>
<li><a href="/faq/">F.A.Q.</a></li>
<li><a href="/contact-us/">Contact Us</a></li>
<li><a href="/archive/">Blog Archive</a></li>
<li><a href="/privacy/">Privacy Policy</a></li>
</ul>
</li>
Expand Down
19 changes: 19 additions & 0 deletions archive/index.html
@@ -0,0 +1,19 @@
---
layout: single
---

<section class="archive-post-list">

{% for post in site.posts %}
{% assign currentDate = post.date | date: "%Y" %}
{% if currentDate != myDate %}
{% unless forloop.first %}</ul>{% endunless %}
<h1>{{ currentDate }}</h1>
<ul>
{% assign myDate = currentDate %}
{% endif %}
<li><a href="{{ post.url }}"><span>{{ post.date | date: "%B %-d, %Y" }}</span> - {{ post.title }}</a></li>
{% if forloop.last %}</ul>{% endif %}
{% endfor %}

</section>
18 changes: 18 additions & 0 deletions blog/index.html
@@ -0,0 +1,18 @@
---
layout: single
---

<div class="posts">
{% for post in site.posts %}
<article class="post">

<h1><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h1>

<div class="entry">
{{ post.excerpt }}
</div>

<a href="{{ site.baseurl }}{{ post.url }}" class="read-more">Read More</a>
</article>
{% endfor %}
</div>

0 comments on commit 6af99d1

Please sign in to comment.