add index pages for blog post tags
This commit is contained in:
		
							parent
							
								
									d0cc73379f
								
							
						
					
					
						commit
						7e5840e15a
					
				
					 3 changed files with 34 additions and 4 deletions
				
			
		|  | @ -14,7 +14,7 @@ subhead: blog | ||||||
|                 {% if tags %} |                 {% if tags %} | ||||||
|                     <span>in  |                     <span>in  | ||||||
|                         {% for tag in tags %} |                         {% for tag in tags %} | ||||||
|                             <span class="tag"><a href="#">{{ tag }}</a></span>{% if not loop.last %}, {% endif %} |                             <span class="tag"><a href="/posts/tagged/{{ tag }}/">{{ tag }}</a></span>{% if not loop.last %}, {% endif %} | ||||||
|                         {% endfor %} |                         {% endfor %} | ||||||
|                     </span> |                     </span> | ||||||
|                 {% endif %} |                 {% endif %} | ||||||
|  |  | ||||||
|  | @ -40,16 +40,19 @@ footer, | ||||||
|   font-size: 0.75rem; |   font-size: 0.75rem; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| time, .author { | time, | ||||||
|  | .author { | ||||||
|   font-weight: bold; |   font-weight: bold; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .article_header { | .article_header, | ||||||
|  | .page_header { | ||||||
|   padding-bottom: 4px; |   padding-bottom: 4px; | ||||||
|   border-bottom: 1px dotted rgb(219, 103, 167); |   border-bottom: 1px dotted rgb(219, 103, 167); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .article_header > h1 { | .article_header > h1, | ||||||
|  | .page_header > h1 { | ||||||
|   margin: 0.1rem; |   margin: 0.1rem; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										27
									
								
								src/tagged.njk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								src/tagged.njk
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,27 @@ | ||||||
|  | --- | ||||||
|  | eleventyComputed: | ||||||
|  |   title: posts tagged "{{ tag }}" | ||||||
|  | subhead: blog | ||||||
|  | pagination: | ||||||
|  |   data: collections | ||||||
|  |   size: 1 | ||||||
|  |   alias: tag | ||||||
|  |   filter:  | ||||||
|  |     - posts | ||||||
|  |   addAllPagesToCollections: true | ||||||
|  | permalink: /posts/tagged/{{ tag }}/index.html | ||||||
|  | --- | ||||||
|  | {% extends 'layouts/default.njk' %} | ||||||
|  | {% block main %} | ||||||
|  |         <header class="page_header"> | ||||||
|  |             <h1>posts tagged "{{ tag }}"</h1> | ||||||
|  |         </header> | ||||||
|  |   <ul> | ||||||
|  |     {% set taglist = collections[ tag ] %} | ||||||
|  |     {% for entry in taglist | reverse %} | ||||||
|  |     <li> | ||||||
|  |       <span><a href="{{ entry.url }}">{{ entry.data.title }}</a> on <span><time datetime="{{ entry.date | date_to_datetime }}">{{ entry.date | date_formatted }}</time></span></span> | ||||||
|  |     </li> | ||||||
|  |     {% endfor %} | ||||||
|  |   </ul> | ||||||
|  | {% endblock %} | ||||||
		Loading…
	
		Reference in a new issue