Skip to content

Commit 281e7d3

Browse files
committed
add templates for authors. creativecommons#53
1 parent 1036f49 commit 281e7d3

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

templates/author.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% extends "layout.html" %}
2+
{% from "macros/authors.html" import render_blog_list %}
3+
{% block title %}{{ this.name }}{% endblock %}
4+
{% block header %}CC Technical Blog Archives{% endblock %}
5+
{% block body %}
6+
<h2>Blog Posts by {{ this.name }}</h2>
7+
{{ render_blog_list(this.children) }}
8+
<hr>
9+
<strong><a href="/blog/authors">All Authors</a></strong>
10+
{% endblock %}

templates/authors.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% extends "layout.html" %}
2+
{% from "macros/authors.html" import render_authors %}
3+
{% block title %}Authors{% endblock %}
4+
{% block header %}CC Technical Blog Archives{% endblock %}
5+
{% block body %}
6+
<h1>Authors</h1>
7+
{{ render_authors() }}
8+
{% endblock %}

templates/macros/authors.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% macro render_authors() %}
2+
<ul>
3+
{% for author in site.query('/authors') %}
4+
<li><a href="{{ author|url }}">{{ author.name }}</a></li>
5+
{% endfor %}
6+
</ul>
7+
{% endmacro %}
8+
9+
{% macro render_blog_list(blogs) %}
10+
<ul>
11+
{% for blog in blogs %}
12+
<li><a href="{{ blog|url }}">{{ blog.title }}</a></li>
13+
{% endfor %}
14+
</ul>
15+
{% endmacro %}

0 commit comments

Comments
 (0)