Browse Source

Merge pull request #5 from Keats/v0.4

Update theme to gutenberg 0.4
master
Vincent Prouillet 6 years ago committed by GitHub
parent
commit
4e9183b930
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      README.md
  2. 6
      config.toml
  3. 4
      content/some-article.md
  4. 2
      content/some-other-article.md
  5. 6
      templates/categories/list.html
  6. 4
      templates/categories/single.html
  7. 17
      templates/page.html
  8. 6
      templates/tags/list.html
  9. 4
      templates/tags/single.html
  10. 6
      theme.toml

13
README.md

@ -30,6 +30,19 @@ paginate_by = 5
The posts should therefore be in directly under the `content` folder. The posts should therefore be in directly under the `content` folder.
The theme requires tags and categories taxonomies to be enabled in your `config.toml`:
```toml
taxonomies = [
# You can enable/disable RSS
{name = "categories", rss = true},
{name = "tags", rss = true},
]
```
If you want to paginate taxonomies pages, you will need to overwrite the templates
as it only works for non-paginated taxonomies by default.
## Options ## Options
### Top-menu ### Top-menu

6
config.toml

@ -3,8 +3,10 @@ compile_sass = true
title = "after-dark theme" title = "after-dark theme"
description = "" description = ""
generate_tags_pages = true taxonomies = [
generate_categories_pages = true {name = "categories", rss = true},
{name = "tags", rss = true},
]
[extra] [extra]
author = "Vincent" author = "Vincent"

4
content/some-article.md

@ -1,7 +1,9 @@
+++ +++
title = "What is Gutenberg" title = "What is Gutenberg"
date = 2017-09-24 date = 2017-09-24
category = "Hello world"
[taxonomies]
categories = ["Hello world"]
+++ +++
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eu feugiat sapien. Aenean ligula nunc, laoreet id sem in, interdum bibendum felis. Donec vel dui neque. Praesent ac sem ut justo volutpat rutrum a imperdiet tellus. Nam lobortis massa non hendrerit hendrerit. Vivamus porttitor dignissim turpis, eget aliquam urna tincidunt non. Aliquam et fringilla turpis. Nullam eros est, eleifend in ornare sed, hendrerit eget est. Aliquam tellus felis, suscipit vitae ex vel, fringilla tempus massa. Nulla facilisi. Pellentesque lobortis consequat lectus. Maecenas ac libero elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eu feugiat sapien. Aenean ligula nunc, laoreet id sem in, interdum bibendum felis. Donec vel dui neque. Praesent ac sem ut justo volutpat rutrum a imperdiet tellus. Nam lobortis massa non hendrerit hendrerit. Vivamus porttitor dignissim turpis, eget aliquam urna tincidunt non. Aliquam et fringilla turpis. Nullam eros est, eleifend in ornare sed, hendrerit eget est. Aliquam tellus felis, suscipit vitae ex vel, fringilla tempus massa. Nulla facilisi. Pellentesque lobortis consequat lectus. Maecenas ac libero elit.

2
content/some-other-article.md

@ -2,6 +2,8 @@
title = "A first theme for Gutenberg" title = "A first theme for Gutenberg"
date = 2017-09-25 date = 2017-09-25
category = "Prog" category = "Prog"
[taxonomies]
tags = ["rust", "ssg", "other"] tags = ["rust", "ssg", "other"]
+++ +++

6
templates/categories.html → templates/categories/list.html

@ -7,11 +7,11 @@
<h1>Categories</h1> <h1>Categories</h1>
{% if categories %} {% if terms %}
<ul> <ul>
{% for category in categories %} {% for term in terms %}
<li> <li>
<a href="{{ category.permalink }}">{{ category.name }}</a>({{ category.pages | length }}) <a href="{{ term.permalink }}">{{ term.name }}</a>({{ term.pages | length }})
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>

4
templates/category.html → templates/categories/single.html

@ -6,9 +6,9 @@
{{ super() }} {{ super() }}
{% endblock header %} {% endblock header %}
<h1>{{ category.name }}</h1> <h1>{{ term.name }}</h1>
{% for page in category.pages %} {% for page in term.pages %}
{{ post_macros::page_in_list(page=page) }} {{ post_macros::page_in_list(page=page) }}
{% endfor %} {% endfor %}
{% endblock content %} {% endblock content %}

17
templates/page.html

@ -19,16 +19,17 @@
{% if config.extra.author %} {% if config.extra.author %}
Published by {{ config.extra.author }} Published by {{ config.extra.author }}
{% endif %} {% endif %}
{% if page.category %} {% if page.taxonomies.categories %}
in <a href="{{ get_taxonomy_url(kind="category", name=page.category) }}">{{ page.category }}</a> {% set category = page.taxonomies.categories[0] %}
in <a href="{{ get_taxonomy_url(kind="categories", name=category) }}">{{ category }}</a>
{% endif %} {% endif %}
{% if page.tags %} {% if page.taxonomies.tags %}
and tagged and tagged
{% for tag in page.tags %} {% for tag in page.taxonomies.tags %}
<a href="{{ get_taxonomy_url(kind="tag", name=tag) }}">{{ tag }}</a> <a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a>
{% if page.tags | length > 1 %} {% if page.taxonomies.tags | length > 1 %}
{% if loop.index != page.tags | length %} {% if loop.index != page.taxonomies.tags | length %}
{% if loop.index == page.tags | length - 1 %} {% if loop.index == page.taxonomies.tags | length - 1 %}
and and
{% else %} {% else %}
, ,

6
templates/tags.html → templates/tags/list.html

@ -7,10 +7,10 @@
<h1>Tags</h1> <h1>Tags</h1>
{% if tags %} {% if terms %}
<ul> <ul>
{% for tag in tags %} {% for term in terms %}
<li><a href="{{ tag.permalink }}">{{ tag.name }}</a> ({{ tag.pages | length }})</li> <li><a href="{{ term.permalink }}">{{ term.name }}</a> ({{ term.pages | length }})</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}

4
templates/tag.html → templates/tags/single.html

@ -5,9 +5,9 @@
{{ super() }} {{ super() }}
{% endblock header %} {% endblock header %}
<h1>{{ tag.name }}</h1> <h1>{{ term.name }}</h1>
{% for page in tag.pages %} {% for page in term.pages %}
{{ post_macros::page_in_list(page=page) }} {{ post_macros::page_in_list(page=page) }}
{% endfor %} {% endfor %}
{% endblock content %} {% endblock content %}

6
theme.toml

@ -2,7 +2,7 @@ name = "after-dark"
description = "A robust, elegant dark theme" description = "A robust, elegant dark theme"
license = "MIT" license = "MIT"
homepage = "https://github.com/Keats/after-dark" homepage = "https://github.com/Keats/after-dark"
min_version = "0.2" min_version = "0.4.0"
[extra] [extra]
@ -13,5 +13,5 @@ homepage = "https://vincent.is"
[original] [original]
author = "comfusion" author = "comfusion"
homepage = "https://comfusion.github.io/after-dark/" homepage = "https://git.habd.as/comfusion/after-dark/"
repo = "https://github.com/comfusion/after-dark" repo = "https://git.habd.as/comfusion/after-dark/"

Loading…
Cancel
Save