diff --git a/docs/config.toml b/docs/config.toml index 262f7dd7e9..656d451fc9 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -5,6 +5,10 @@ description = "Everything you need to make a static site engine in one binary." compile_sass = true build_search_index = true +taxonomies = [ + { name = "theme-tags"} +] + [search] index_format = "elasticlunr_json" diff --git a/docs/content/documentation/themes/creating-a-theme.md b/docs/content/documentation/themes/creating-a-theme.md index ae862b267e..1931e73447 100644 --- a/docs/content/documentation/themes/creating-a-theme.md +++ b/docs/content/documentation/themes/creating-a-theme.md @@ -16,6 +16,8 @@ following fields: ```toml name = "my theme name" description = "A classic blog theme" +# An optional tags to allow quick search +tags = [] license = "MIT" homepage = "https://github.com/getzola/hyde" # The minimum version of Zola required diff --git a/docs/templates/theme-tags/list.html b/docs/templates/theme-tags/list.html new file mode 100644 index 0000000000..bb2b5ee4e6 --- /dev/null +++ b/docs/templates/theme-tags/list.html @@ -0,0 +1,17 @@ +{% extends "index.html" %} + +{% block extra_nav_class %}{% endblock extra_nav_class %} +{% block extra_content_class %}content--reversed{% endblock extra_content_class %} + +{% block title %}Themes | {{ super() }} {% endblock title %} + +{% block content %} +

Tags

+{% set section = get_section(path = "themes/_index.md") %} +

All themes ({{ section.pages | length }}

+ +{% endblock content %} \ No newline at end of file diff --git a/docs/templates/theme-tags/single.html b/docs/templates/theme-tags/single.html new file mode 100644 index 0000000000..b11bc95603 --- /dev/null +++ b/docs/templates/theme-tags/single.html @@ -0,0 +1,22 @@ +{% extends "index.html" %} + +{% block extra_nav_class %}{% endblock extra_nav_class %} +{% block extra_content_class %}content--reversed{% endblock extra_content_class %} + +{% block title %}Themes | {{ super() }} {% endblock title %} + +{% block content %} +
+ {% block theme_content %} +

Zola themes in {{ term.name }}

+
+ {% for theme in term.pages %} + + Screenshot of {{theme.title}} + {{theme.title}} + + {% endfor %} +
+ {% endblock theme_content %} +
+{% endblock content %} diff --git a/docs/templates/theme.html b/docs/templates/theme.html index 27c1f08a3e..aac0f0c8e8 100644 --- a/docs/templates/theme.html +++ b/docs/templates/theme.html @@ -13,6 +13,16 @@

{{ page.title }}

{% if page.extra.demo %}

Live Demo: {{page.extra.demo}}

{% endif %} + {% if page.taxonomies["theme-tags"] %} +
+

Tags:

+
+ {% endif %}

Last updated: {{page.extra.updated }}

diff --git a/docs/templates/themes.html b/docs/templates/themes.html index 85a837112d..8ede7f2e47 100644 --- a/docs/templates/themes.html +++ b/docs/templates/themes.html @@ -9,6 +9,10 @@
{% block theme_content %}

Zola themes

+ {% set tax = get_taxonomy(kind = "theme-tags") %} + {% if tax and tax.items | length > 0 %} +

Search by tags

+ {% endif %}
{% for theme in section.pages %}