Skip to content

Commit

Permalink
Removed dot for pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fadado committed Dec 2, 2018
1 parent bfb2f29 commit 31f7695
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions bin/jqt
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ function convert
echo "import \"${basename}\" as \$${module};"
done

# $M as a global reference to '.'
echo '. as $M |'
# $jqt as a global reference to '.'
echo '. as $jqt |'

# define helper functions for JSON modules
for module in ${!IMPORTS[@]}; do
Expand Down
2 changes: 1 addition & 1 deletion docs/blocks/body/_blog/markup.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Body for blog posts
######################################################################>&
<main class="#body">
{% pages("blog")[] %}
{% pages[] | select(.Section=="blog") %}
<div class="post-excerpt">
<a class="post-excerpt__title" href="{{.Base}}{{.URL}}">{{.title}}</a>
<p class="post-excerpt__test">{{.description}}
Expand Down
15 changes: 8 additions & 7 deletions docs/blocks/filters.jq
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Extra filters for this site
#

import "pages-by-id" as $pages;
#import "pages-by-id" as $pages;
#import "phase1_site" as $site;

# Remove XML tags
Expand All @@ -12,14 +12,15 @@ def striptags:
;

#def site: $site::site[0];
def pages: $pages::pages[0];
#def pages: $pages::pages[0];

def pages($section):
[$pages::pages[0][] | select(.Section=="blog")]
;
#def pages($section):
# [$pages::pages[0][] | select(.Section=="blog")]
#;

def sections:
[$pages::pages[0].section]
def sections($pages):
# . as $pages
map(.section)
| unique
| map(select(. != null and . != ""))
;
Expand Down
4 changes: 2 additions & 2 deletions docs/blocks/menu-bar/markup.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
######################################################################>&
<ol class="menu-bar">
{% site.menu[] %}
<li class='menu-bar__item {{if .==$M.page.Id then "menu-bar__item_current" else "" end}}'>
<li class='menu-bar__item {{if .==$jqt.page.Id then "menu-bar__item_current" else "" end}}'>
{% (. as $id | pages[] | select($id == .Id)) as $page %}
<a href="{{$M.page.Base}}{{$page.URL}}">{{$page.name}}</a>
<a href="{{$jqt.page.Base}}{{$page.URL}}">{{$page.name}}</a>
{% end %}
</li>
{% end %}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/jqt.1.text
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Copyright © 2015 Joan Josep Ordinas Rosa.

# SEE ALSO

**gpp(1)**, **jq(1)**, **pandoc(1)**, **sake(1)**
**jq(1)**, **gpp(1)**, **pandoc(1)**, **sake(1)**

**jqt** home page: <https://fadado.github.com/jqt/>

Expand Down
1 change: 1 addition & 0 deletions share/sake.d/phase3.make
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ define JQTFLAGS :=
-L$(Meta) \
-L$(Blocks) \
-jsite:phase1_site.json \
-jpages:pages-by-id.json \
-ifilters
endef

Expand Down

0 comments on commit 31f7695

Please sign in to comment.