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?
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:
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:
or directly in weblorg-site, in order to avoid duplication for each route.
Is something like this already possible in weblorg?