Add support for series
This commit is contained in:
		
							parent
							
								
									030b0d3767
								
							
						
					
					
						commit
						aa88d6f909
					
				| @ -77,7 +77,7 @@ THEME = "theme" | |||||||
| 
 | 
 | ||||||
| MENUITEMS = [ | MENUITEMS = [ | ||||||
|     ("posts", ""), |     ("posts", ""), | ||||||
|     ("projects", "projects.html"), |     ("series", "series.html"), | ||||||
|     ("about", "about.html"), |     ("about", "about.html"), | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -5,6 +5,7 @@ livereload==2.7.1 | |||||||
| Markdown==3.7 | Markdown==3.7 | ||||||
| pelican==4.11.0 | pelican==4.11.0 | ||||||
| pelican-neighbors==1.2.0 | pelican-neighbors==1.2.0 | ||||||
|  | pelican-series==3.0.0 | ||||||
| pelican-sitemap==1.2.0 | pelican-sitemap==1.2.0 | ||||||
| pelican-statistics==1.0.0 | pelican-statistics==1.0.0 | ||||||
| pelican-webassets==2.1.0 | pelican-webassets==2.1.0 | ||||||
|  | |||||||
| @ -200,6 +200,30 @@ footer { | |||||||
|   @apply font-mono text-lg text-zinc-400; |   @apply font-mono text-lg text-zinc-400; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | .article-series { | ||||||
|  |   @apply italic my-8; | ||||||
|  | 
 | ||||||
|  |   .series-name { | ||||||
|  |     @apply font-bold; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   ol { | ||||||
|  |     @apply list-decimal list-inside; | ||||||
|  | 
 | ||||||
|  |     li { | ||||||
|  |       @apply not-italic; | ||||||
|  | 
 | ||||||
|  |       &::marker { | ||||||
|  |         @apply font-mono; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       span { | ||||||
|  |         @apply text-zinc-400; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| article { | article { | ||||||
|   @apply font-light mt-8 text-lg; |   @apply font-light mt-8 text-lg; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -38,6 +38,23 @@ | |||||||
| </div> | </div> | ||||||
| 
 | 
 | ||||||
| <article role="article"> | <article role="article"> | ||||||
|  | {% if article.series %} | ||||||
|  | <div class="article-series"> | ||||||
|  |   <p>This article is part {{ article.series.index }} of the <span class="series-name">{{ article.series.name }}</span> series:</p> | ||||||
|  |   <ol> | ||||||
|  |   {% for part_article in article.series.all %} | ||||||
|  |     <li> | ||||||
|  |       {% if part_article == article %} | ||||||
|  |       <span>{{ part_article.title }}</span> | ||||||
|  |       {% else %} | ||||||
|  |       <a href="{{ SITEURL }}/{{ part_article.url }}">{{ part_article.title }}</a> | ||||||
|  |       {% endif %} | ||||||
|  |     </li> | ||||||
|  |   {% endfor %} | ||||||
|  |   </ol> | ||||||
|  | </div> | ||||||
|  | {% endif %} | ||||||
|  | 
 | ||||||
| {{ article.content }} | {{ article.content }} | ||||||
| </article> | </article> | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										30
									
								
								theme/templates/series.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								theme/templates/series.html
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,30 @@ | |||||||
|  | {% extends "partials/_base.html" %} | ||||||
|  | 
 | ||||||
|  | {# Page title: #} | ||||||
|  | {% block title %}{{ page.title|lower }} | {{ SITENAME|lower }}{% endblock %} | ||||||
|  | 
 | ||||||
|  | {# Page metadata: #} | ||||||
|  | {% block meta %} | ||||||
|  | <meta name="description" content="" /> | ||||||
|  | <link rel="canonical" href="{{ SITEURL }}/{{ page.url }}" /> | ||||||
|  | {% endblock %} | ||||||
|  | 
 | ||||||
|  | {# Page content: #} | ||||||
|  | {% block content %} | ||||||
|  | <h1>{{ page.title }}</h1> | ||||||
|  | 
 | ||||||
|  | {% for series_name, series_articles in article_series|items %} | ||||||
|  | <h2>{{ series_name }}</h2> | ||||||
|  | <ul class="post-list"> | ||||||
|  | {% for article in series_articles|sort(attribute="locale_date") %} | ||||||
|  |   <li class="flex-col md:flex-row mb-4 md:mb-2"> | ||||||
|  |     <span class="date text-base md:text-lg">{{ article.locale_date }}</span> | ||||||
|  |     <span class="title"> | ||||||
|  |       <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a> | ||||||
|  |     </span> | ||||||
|  |   </li> | ||||||
|  | {% endfor %} | ||||||
|  | </ul> | ||||||
|  | {% endfor %} | ||||||
|  | 
 | ||||||
|  | {% endblock content %} | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user