Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

k94ll13nn3/Pretzel.Categories

Repository files navigation

Pretzel.Categories

Build status Release

A category and tag pages generator for Pretzel (version 0.4 or greater)

This is a plugin for the static site generation tool Pretzel.

Category Pages

This plugin will automatically generate category pages during build. Each category page is saved as_site/category/<slugified-category-name>/index.html.

This can be disabled by using the -ncategory option with the taste or bake command.

You can specify a layout by setting the category_pages_layout configuration key in the config.yml (it uses layout by default). In the layout, you can access the category name by using page.category.

Tag Pages

This plugin will automatically generate tag pages during build. Each tag page is saved as_site/tag/<slugified-tag-name>/index.html.

This can be disabled by using the -ntag option with the taste or bake command.

You can specify a layout by setting the tag_pages_layout configuration key in the config.yml (it uses layout by default). In the layout, you can access the tag name by using page.tag.

Layout example

Example of a layout for a page listing all posts by category:

---
layout: layout
---

<div>
  <h1>{{page.category}}</h1>
  {% for t in site.categories %}
    {% if t.Name == page.category %}
      {% for post in t.posts reverse %}
        <ul>
          <li>
            <a href="{{ post.url }}">{{ post.title }}</a>
          </li>
        </ul>
      {% endfor %}
    {% endif %}
  {% endfor %}
</div>

Installation

Download the latest release and copy Pretzel.Categories.dll to the _plugins folder at the root of your site folder (you may have to unblock the file).

About

A category and tag page generator for Pretzel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages