diff --git a/config.toml b/config.toml index b6e4a7c..5a4f9f1 100644 --- a/config.toml +++ b/config.toml @@ -7,6 +7,11 @@ compile_sass = true # Whether to build a search index to be used later on by a JavaScript library build_search_index = true +taxonomies = [ + {name = "tags", feed = true}, # each tag will have its own feed + {name = "categories", paginate_by = 5}, # 5 items per page for a term + ] + [markdown] # Whether to do syntax highlighting # Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola @@ -14,3 +19,7 @@ highlight_code = true [extra] # Put all your custom variables here +authors = [ + { "nick"="dachary", name="Loïc Dachary", "website"="https://dachary.org" }, + { "nick"="realaravinth", name="Aravinth Manivannan", "website"="https://batsense.net" } +] diff --git a/templates/blog/_meta.html b/templates/blog/_meta.html new file mode 100644 index 0000000..a91eb76 --- /dev/null +++ b/templates/blog/_meta.html @@ -0,0 +1,4 @@ +

+ {{ macros::get_author(nick=page.extra.author) }} · {{ page.day }} {{ macros::get_month(month=page.month) }}, + {{ page.year }} · {{ page.reading_time }} min read +

diff --git a/templates/blog/index.html b/templates/blog/index.html new file mode 100644 index 0000000..41a007a --- /dev/null +++ b/templates/blog/index.html @@ -0,0 +1,31 @@ +{% extends "base.html" %} {% block meta %} + +{% set title = "Posts" %} +{% set description = title %} +{{ macros::get_meta_tags(title=title, description=description) }} + +{% endblock meta %} {% block content %} +
+

{{ section.title }}

+ +
+ {% block rss %} + + {% endblock %} +{% endblock content %} diff --git a/templates/blog/post.html b/templates/blog/post.html new file mode 100644 index 0000000..8bff152 --- /dev/null +++ b/templates/blog/post.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} {% block meta %} + +{% set description = page.title %} +{{ macros::get_meta_tags(title=page.title, description=description) }} + +{% endblock meta %} {% block content %} + +
+

{{ page.title }}

+ {% include "blog/_meta.html" %} + +
+ {{ page.content | safe }} +
+
+
+
+ {% for t in page.taxonomies.tags %} + + {% endfor %} +
+ +
+ +{% endblock content %} diff --git a/templates/macros.html b/templates/macros.html index 48520a3..ce35da9 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -168,3 +168,11 @@ {{ name }} {% endmacro nav_link %} + +{% macro get_author(nick) %} + {% for author in config.extra.authors %} + {% if author.nick == nick %} + {{ author.name }} + {% endif %} + {% endfor %} +{% endmacro get_author %}