Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As blogger I want to be able to categorize my posts, so that my posts be organized. #5

guilhermecomum opened this issue Aug 11, 2020 · 1 comment


Copy link

No description provided.

@guilhermecomum guilhermecomum added this to the Release 1 milestone Aug 26, 2020
Copy link

clarete commented Jan 3, 2021

There are a few things we need in order to get this working:

  1. the code for generating the pages for each category. the snippet below will generate a directory for each category name with an index.html file within it:

     :name "categories"
     :input-pattern "posts/*.org"
     :input-aggregate #'weblorg-input-aggregate-by-category ;; also look at weblorg-input-aggregate-by-category-desc
     :template "category.html"
     :output "blog/{{ name }}/index.html"
     :url "/blog/{{ name }}")
    ;; the template will link to the `posts` route with `url_for`.
     :name "posts"
     :input-pattern "posts/*.org"
     :template "post.html"
     :output "blog/{{ slug }}.html"
     :url "/blog/{{ slug }}.html")
  2. The category.html template present in the templates path (we don't have any themes shipping this file yet 😢)

    {% extends "layout.html" %}
    {% block body %}
      <div class="title"><h1>{{ }}</h1></div>
      <div class="content">
          {% for post in category.posts %}
              <span class="pubdate">{{ }}</span>
              <a href="{{ url_for("posts", slug=post.slug) }}">{{ post.title }}</a>
          {% endfor %}
    {% endblock %}

@guilhermecomum guilhermecomum added this to To do in Weblorg Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
To do

No branches or pull requests

2 participants