Skip to content

Commit

Permalink
Minor editions
Browse files Browse the repository at this point in the history
  • Loading branch information
fadado committed Apr 24, 2017
1 parent e4e7c71 commit e33ca7e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
9 changes: 8 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ ifdef __phase_2
# __phase_3
# Defined rules for:
# $(Metadata)/phase3.make
# $(DestinationPages)
# Defined targets:
# all
# build
Expand Down Expand Up @@ -130,6 +129,14 @@ include project.make
#
# Project specific makefile. All the previous modules are expected to be
# independent, valid for any project without any change.
#
# Defined rules for:
# $(ManPage)
# /tmp/help
# Defined targets:
# all
# clean
# clobber
########################################################################

endif # __phase_3
Expand Down
30 changes: 18 additions & 12 deletions docs/make.d/phase21.jq
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,23 @@ def page_path:
def page_section:
$Target
| if test("(?<!/pages)/index.json$") # index but not home page
then null
else page_path[:-1] end
then null
else page_path[:-1] end
;

# derived
def page_slug:
$Target | page_name+".html"
.filename + ".html"
;

def page_date:
page_name |
(capture("^(?<date>\\d{4}-\\d{2}-\\d{2})-") | .date)
// ""
.filename |
(capture("^(?<YMD>\\d{4}-\\d{2}-\\d{2})-") | .YMD)
// ""
;

def page_url:
.path + .slug
;

########################################################################
Expand All @@ -65,15 +70,16 @@ def defaults:

def properties:
{
base: page_base,
date: page_date,
id: page_id,
path: page_path,
base: page_base,
filename: page_name,
section: page_section,
slug: page_slug,
source: $Source,
url: (page_path+page_slug)
path: page_path,
source: $Source
}
| .date = page_date # in this order!
| .slug = page_slug
| .url = page_url
;

. as $front_matter |
Expand Down
8 changes: 6 additions & 2 deletions docs/make.d/phase3.jq
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ def use:
;

def flags:
if .flags then .flags | join(" ") else "" end
if .flags
then .flags | join(" ")
else "" end
;

def data:
if .data then .data | map("-m\(.):$(Metadata)/snippets.json") | join(" ") else "" end
if .data
then .data | map("-m\(.):$(Metadata)/snippets.json") | join(" ")
else "" end
;

########################################################################
Expand Down
2 changes: 1 addition & 1 deletion docs/project.make
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
########################################################################
#
# Specific makefile for this web site
# Specific makefile for this web site
#
# Defined rules for:
# $(ManPage)
Expand Down

0 comments on commit e33ca7e

Please sign in to comment.