Skip to content

Question: How to explicitly set all posts in a route or site? #48

Description

@markokocic

I want to have a list of all posts/pages matching some filter and have it available inside a route or site.
Lets say I have a rout to render all posts:

(weblorg-route
 ;; route for rendering each post
 :site blog
 :name "posts"
 :input-pattern "posts/*.org"
 :template "post.html"
 :output "output/posts/{{ slug }}.html"
 :url "/posts/{{ slug }}.html")

I want to add two more variable to the each page, so that I can list links to pages in sidebar, and display 4 recent posts title in footer. For that I would like to have something like:

(weblorg-route
 ;; route for rendering each post
 :site blog
 :name "posts"
 :input-pattern "posts/*.org"
 :template "post.html"
 :output "output/posts/{{ slug }}.html"
 :url "/posts/{{ slug }}.html"
 :template-vars '(("all_posts" (some-function "posts/*.org"))
                  ("all_pages" (some-function "pages/*.org")))

or directly in weblorg-site, in order to avoid duplication for each route.

(weblorg-site
 :template-vars '(("all_posts" (some-function "posts/*.org"))
                  ("all_pages" (some-function "pages/*.org")))
)

Is something like this already possible in weblorg?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions