-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #397 from phansch/notes-2
Add notes listing page / refactor
- Loading branch information
Showing
4 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
+++ | ||
title = "Recent Notes" | ||
template = "notes.html" | ||
page_template = "post.html" | ||
sort_by = "date" | ||
+++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% import "macros/time_to_read.html" as util %} | ||
{% macro post_meta(resource) %} | ||
<p class="meta"> | ||
— <a href="{{ resource.permalink }}" class="u-url" title="Permalink"> | ||
<em> | ||
<time class="dt-published" datetime="{{ resource.date }}">{{ resource.date | date(format="%d %b %Y") }}</time> | ||
</em> | ||
</a>, | ||
<em>{{ util::time_to_read(content=resource.content) }}</em> | ||
</p> | ||
{% endmacro post_meta %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% extends "base.html" %} | ||
{% import "macros/post_meta.html" as macros %} | ||
|
||
{% block content %} | ||
<h2>{{ section.title }}</h2> | ||
{% for note in section.pages %} | ||
{{ macros::post_meta(resource=note) }} | ||
<h3>{{ note.title }}</h3> | ||
{{ note.content | safe}} | ||
<hr /> | ||
{% endfor %} | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters