Create blog directory

This commit is contained in:
Yash Karandikar 2021-11-20 14:52:22 -06:00
parent 16ec41716b
commit 012fedaaa1
Signed by: karx
GPG Key ID: A794DA2529474BA5
5 changed files with 38 additions and 1 deletions

6
content/blog/_index.md Normal file
View File

@ -0,0 +1,6 @@
+++
title = "List of blog posts"
sort_by = "date"
template = "blog.html"
page_template = "blog-page.html"
+++

6
content/blog/first.md Normal file
View File

@ -0,0 +1,6 @@
+++
title = "My first post"
date = "2021-11-20"
+++
This is my first blog post.

View File

@ -17,7 +17,7 @@
{% block content %} {% endblock %}
<hr>
<div style="text-align: center">
<a href="/">home</a> - <a href="/projects/">projects</a> - built with <a href="https://www.getzola.org/">zola</a>
<a href="/">home</a> - <a href="/projects/">projects</a> - <a href="/blog/">blog</a> - built with <a href="https://www.getzola.org/">zola</a>
</div>
</div>
</section>

13
templates/blog-page.html Normal file
View File

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% block content %}
<h1>
{{ page.title }}
</h1>
<p>
<strong>
{{ page.date }}
</strong>
</p>
{{ page.content | safe }}
{% endblock content %}

12
templates/blog.html Normal file
View File

@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block content %}
<h1>
{{ section.title }}
</h1>
<ul>
{% for page in section.pages %}
<li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li>
{% endfor %}
</ul>
{% endblock content %}