mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Add a “news” category
This commit is contained in:
4
blog/content/news/_index.md
Normal file
4
blog/content/news/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
+++
|
||||
title = "News"
|
||||
template = "news-section.html"
|
||||
+++
|
||||
28
blog/templates/news-page.html
Normal file
28
blog/templates/news-page.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
|
||||
|
||||
{% block main %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
|
||||
{{ page.date | date(format="%b %d, %Y") }}
|
||||
{% if page.extra.updated %} (updated on {{ page.extra.updated | date(format="%b %d, %Y") }}) {% endif %}
|
||||
</time>
|
||||
{{ page.content | safe }}
|
||||
{% endblock main %}
|
||||
|
||||
{% block after_main %}
|
||||
<hr>
|
||||
<section>
|
||||
<h2 id="comments">Comments</h2>
|
||||
<script src="https://utteranc.es/client.js"
|
||||
repo="phil-opp/blog_os"
|
||||
branch="master"
|
||||
issue-term="pathname"
|
||||
async>
|
||||
</script>
|
||||
</section>
|
||||
|
||||
{% endblock after_main %}
|
||||
|
||||
|
||||
28
blog/templates/news-section.html
Normal file
28
blog/templates/news-section.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
<h1>{{ section.title }}</h1>
|
||||
|
||||
{% block introduction %}{% endblock introduction %}
|
||||
|
||||
<div class="posts neutral">
|
||||
{% for page in section.pages|reverse %}
|
||||
<article>
|
||||
<h2 class="post-title"><a href="/{{ page.path | safe }}">{{ page.title }}</a></h2>
|
||||
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
|
||||
{{ page.date | date(format="%b %d, %Y") }}
|
||||
</time>
|
||||
<div class="post-summary">
|
||||
{{ page.summary | safe}}
|
||||
<a class="read-more" href="/{{ page.path | safe }}">read more…</a>
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endblock main %}
|
||||
Reference in New Issue
Block a user