From 835f6ee37c15343a640edcd8fda3f41a6db26fd7 Mon Sep 17 00:00:00 2001 From: Joan Josep Ordinas Rosa Date: Thu, 20 Apr 2017 20:23:51 +0200 Subject: [PATCH] Defined "pages" filter --- README.md | 2 +- docs/blocks/body/_blog/markup.html | 2 +- docs/blocks/filters.jq | 10 ++++++++++ docs/blocks/menu-bar/markup.html | 4 ++-- docs/config.yaml | 7 +++++++ docs/make.d/data.make | 9 ++------- docs/make.d/pages.make | 8 ++++---- docs/make.d/phase3.jq | 10 +++++++++- docs/make.d/sitemap.make | 2 +- docs/project.make | 14 +++----------- 10 files changed, 40 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index c3299e7..ee53ed1 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The tools used in the implementation of _jqt_ are: If you want to learn how to use _jqt_ visit the site . The site pages are generated using _jqt_ in the [`docs`](./docs/) folder of this repository. -If you are interested in _jq_ you can see also [JBOL](https://fadado.github.io/jbol/), +If you are interested in _jqt_ you can see also [JBOL](https://github.com/fadado/jbol), a related project with a collection of modules for the _jq_ language. _jqt_ is developed under the _Fedora_ Linux distribution, and a lot of diff --git a/docs/blocks/body/_blog/markup.html b/docs/blocks/body/_blog/markup.html index 2a37781..58e737a 100644 --- a/docs/blocks/body/_blog/markup.html +++ b/docs/blocks/body/_blog/markup.html @@ -2,7 +2,7 @@ # Body for blog posts ######################################################################>&
- {% $pages::pages[0][] | select(.section=="blog") %}<#TODO: sort?#> + {% pages[] | select(.section=="blog") %}<#TODO: sort?#>
{{.title}}

{{.description}} diff --git a/docs/blocks/filters.jq b/docs/blocks/filters.jq index 2af7677..69845df 100644 --- a/docs/blocks/filters.jq +++ b/docs/blocks/filters.jq @@ -2,10 +2,20 @@ # Extra filters for this site # +import "collected-front-matter" as $pages; + # Remove XML tags def striptags: # warning: algorithm too simplistic gsub("<[^>]*>"; "") ; +def pages: + $pages::pages[0] +; + +def sections: + [pages[].section] | unique | map(select(.)) +; + # vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=jq diff --git a/docs/blocks/menu-bar/markup.html b/docs/blocks/menu-bar/markup.html index e584206..7019620 100644 --- a/docs/blocks/menu-bar/markup.html +++ b/docs/blocks/menu-bar/markup.html @@ -2,9 +2,9 @@ # Menu Bar ######################################################################>&