Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【参考】自己写了一个归档的页面 #63

Closed
10B-B11 opened this issue May 27, 2018 · 0 comments
Closed

【参考】自己写了一个归档的页面 #63

10B-B11 opened this issue May 27, 2018 · 0 comments

Comments

@10B-B11
Copy link

10B-B11 commented May 27, 2018

自己写了一个归档页面,供大家参考

---
title: Archives
layout: default
---

{% include header.html %}

<div class="g-banner tags-banner {{ site.postPatterns | prepend: 'post-pattern-' }} {{ site.theme-color | prepend: 'bgcolor-' }}" data-theme="{{ site.theme-color }}">
    <h2>ARCHIVES</h2>
</div>


<main class="tags-content" style="margin-top: 0px">
  <ul class="tags-list" style="padding:40px">
    {% for post in site.posts %}
      
        {% unless post.next %}
          <h3 style="margin-bottom: 8px">{{ post.date | date: "%b-%Y" }}</h3>
        {% else %}
        {% capture year %}{{ post.date | date: "%b, %Y" }}{% endcapture %}
        {% capture nyear %}{{ post.next.date | date: "%b, %Y" }}{% endcapture %}
        
        {% if year != nyear %}
           <h3 style="margin-bottom: 8px">{{ post.date | date: "%b-%Y" }}</h3>
        {% endif %}
        {% endunless %}
       
       <li> 
           <a href="{{ post.url }}" style="color: black">{{ post.date | date:"%b-%-d-%Y" }}  {{ post.title }}</a>
       </li>
       
    {% endfor %}
  </ul>
</main>
{% include footer.html %}
@kaeyleo kaeyleo changed the title 自己写了一个归档的页面 【参考】自己写了一个归档的页面 May 27, 2018
@kaeyleo kaeyleo closed this as completed Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants