wip
This commit is contained in:
		
							parent
							
								
									c50f2d4a16
								
							
						
					
					
						commit
						25707bb8a4
					
				
					 4 changed files with 47 additions and 38 deletions
				
			
		
							
								
								
									
										44
									
								
								_layouts/post_by_category.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								_layouts/post_by_category.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,44 @@
 | 
			
		|||
---
 | 
			
		||||
layout: default
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
<article class="page">
 | 
			
		||||
    <h1>{{site.data.categories[page.category].name}}</h1>
 | 
			
		||||
 | 
			
		||||
    <p class='info'>
 | 
			
		||||
        <span>Articles by category</span>
 | 
			
		||||
    </p>
 | 
			
		||||
 | 
			
		||||
    <hr/>
 | 
			
		||||
  
 | 
			
		||||
    <div id="post-content">
 | 
			
		||||
        {% if site.categories[page.category] %}
 | 
			
		||||
            {% for post in site.categories[page.category] %}
 | 
			
		||||
                {% capture post_year %}{{ post.date | date: '%Y' }}{% endcapture %}
 | 
			
		||||
                {% if forloop.first %}
 | 
			
		||||
                    <h3>{{ post_year }}</h3><ul>
 | 
			
		||||
                {% endif %}
 | 
			
		||||
          
 | 
			
		||||
                {% if forloop.first == false %}
 | 
			
		||||
                    {% assign previous_index = forloop.index0 | minus: 1 %}
 | 
			
		||||
                    {% capture previous_post_year %}{{ site.categories[page.category][previous_index].date | date: '%Y' }}{% endcapture %}
 | 
			
		||||
                    {% if post_year != previous_post_year %}
 | 
			
		||||
                        </div><h3>{{ post_year }}</h3><ul>
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                {% endif %}
 | 
			
		||||
          
 | 
			
		||||
                <li>
 | 
			
		||||
                    <a href="{{ post.url }}/" class="read-more">
 | 
			
		||||
                        {{ post.title }}
 | 
			
		||||
                    </a>
 | 
			
		||||
                </li>
 | 
			
		||||
 | 
			
		||||
                {% if forloop.last %}
 | 
			
		||||
                    </ul>
 | 
			
		||||
                {% endif %}
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
        {% else %}
 | 
			
		||||
            <p>There are no posts in this category.</p>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
    </div>
 | 
			
		||||
</article>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue