-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
320 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
# jqt documentation management | ||
######################################################################## | ||
# Makefile for web site management | ||
# | ||
# Project: jqt | ||
# Author: [email protected] <Joan Josep Ordinas Rosa> | ||
# Published: https://fadado.github.io/jqt/ | ||
######################################################################## | ||
|
||
# Make configuration | ||
include make.d/prelude.make | ||
|
||
# jqt/yummy version | ||
Version := $(shell cat ../VERSION) | ||
|
||
######################################################################## | ||
# Globals and setup | ||
######################################################################## | ||
|
||
# Metadata directory | ||
Metadata := .yummy | ||
|
||
# jqt/yummy version | ||
Version := $(shell cat ../VERSION) | ||
|
||
# Load global parameters | ||
# As a side effect config.json and site.json are built | ||
-include $(Metadata)/globals.make | ||
|
||
# Defined in globals.make | ||
|
@@ -34,22 +40,21 @@ ifneq (clobber,$(MAKECMDGOALS)) | |
# Define targets for basic metadata | ||
include make.d/config.make | ||
|
||
# Defined in metadata.make | ||
# ======================== | ||
# Defined in config.make | ||
# ====================== | ||
# Targets: | ||
# $(Metadata) | ||
# $(Metadata)/config.json | ||
# $(Metadata)/site.json | ||
# $(Metadata)/globals.make | ||
# $(Metadata)/pages/**.json | ||
|
||
# Build metadata from introspection | ||
# Build metadata from filesystem introspection | ||
ifdef __globals__ | ||
include make.d/introspect.make | ||
include make.d/pathnames.make | ||
endif | ||
|
||
# Defined in introspect.make | ||
# ========================== | ||
# Defined in pathnames.make | ||
# ========================= | ||
# Variables: | ||
# HomePage | ||
# Pages | ||
|
@@ -58,21 +63,32 @@ endif | |
# NodesJSON | ||
# Targets: | ||
# $(Destination) | ||
# all paths at $(Destination) and $(Metadata) | ||
# each page from his metadata | ||
# all paths starting at $(Destination) and $(Metadata) | ||
|
||
# Build metadata from files front-matter | ||
ifdef __globals__ | ||
include make.d/front-matter.make | ||
endif | ||
|
||
# Defined in front-matter.make | ||
# ============================ | ||
# Targets: | ||
# JSON metadata files at $(Metadata)/pages/ and $(Metadata)/nodes/ | ||
# Additional dependencies defined: | ||
# each page and node from his metadata | ||
|
||
endif # not clobbering | ||
|
||
# Warning: | ||
# | ||
# If `__globals__` is not defined because `globals.make` does not exists, after | ||
# this point most of the file is ignored, but `globals.make` is built because a | ||
# rule exists in the file `metadata.make` (only if the target is not `clobber`). | ||
# rule exists in the file `config.make` (only if the target is not `clobber`). | ||
# Then `Makefile` is restarted, `MAKE_RESTARTS` will be equal to 1, | ||
# `globals.make` is loaded and `__globals__` is defined. | ||
|
||
######################################################################## | ||
# jqt command with options | ||
# Commands | ||
######################################################################## | ||
|
||
ifdef __globals__ | ||
|
@@ -144,7 +160,7 @@ other_pages := $(filter-out $(HomePage),$(Pages)) | |
$(other_pages): \ | ||
$(Content)/FLOW.txt \ | ||
$(Content)/opt/*.txt \ | ||
$(Layouts)/page.html \ | ||
$(Layouts)/default.html \ | ||
|
||
$(HomePage) \ | ||
$(Destination)/structure.html: \ | ||
|
@@ -184,11 +200,11 @@ $(Destination)/$(1).html: $(Content)/$(1).md $(Layouts)/$(2).html \ | |
@$(JQT) -d $$< $(Layouts)/$(2).html | $(DETAILS) > $$@ | ||
endef | ||
|
||
# TODO: instrospect | ||
Home := index | ||
Other := content data engine structure | ||
$(eval $(call Target,$(Home),page)) | ||
$(foreach p,$(Other),$(eval $(call Target,$(p),page-toc))) | ||
# TODO: introspect | ||
home := index | ||
other := content data engine structure | ||
$(eval $(call Target,$(home),page)) | ||
$(foreach p,$(other),$(eval $(call Target,$(p),page-toc))) | ||
|
||
# CSS stylesheet | ||
$(Destination)/styles.css: $(Styles)/page.css | ||
|
@@ -220,32 +236,30 @@ endif # __globals__ | |
|
||
ifndef __globals__ | ||
|
||
clobber: ; | ||
# If clobbering a not initialized project do nothing | ||
clobber: ;@: | ||
|
||
else | ||
|
||
# Delete generated publications | ||
clean: | ||
@rm -rf $(Destination)/* $(ManPage) | ||
|
||
# Delete all generated files and directories | ||
clobber: | ||
@rm -rf $(Destination) $(ManPage) $(Metadata) | ||
|
||
# Build again all documents | ||
build: clean all | ||
|
||
endif # __globals__ | ||
|
||
######################################################################## | ||
# External utilities | ||
######################################################################## | ||
|
||
ifdef __globals__ | ||
# Build again all documents and metadata | ||
xbuild: | ||
@touch config.yaml | ||
@$(MAKE) -s all | ||
|
||
# help and other targets | ||
include make.d/tools.make | ||
|
||
# HTML 5 validation | ||
include make.d/vnu.make | ||
|
||
endif # __globals__ | ||
|
||
# vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<# Top-level page markup #>& | ||
<!DOCTYPE html> | ||
<!-- this document uses polyglot markup (well formed XHTML5) --> | ||
<html id="{{.page._id}}" xmlns="http://www.w3.org/1999/xhtml" lang="{{.page.lang//.site.lang}}" xml:lang="{{.page.lang//.site.lang}}"> | ||
<head> | ||
<# | ||
# Meta elements | ||
#> | ||
<meta charset="utf-8" /> | ||
<# Document title and related metadata #> | ||
<title>jqt · {{.page.title}}</title> | ||
<meta name='description' content='{{.page.description//empty}}' /> | ||
<meta name='keywords' content='{{.page.keywords//empty}}' /> | ||
<meta name='author' content='{{[(.page.author//.site.author)[].name] | sort[]}}' /> | ||
<# More metadata #> | ||
<meta name="generator" content="jqt v<%include ../VERSION>" /> | ||
<meta name='dcterms.date' content='{{.page.updated//empty}}' /> | ||
<# Presentation #> | ||
<link rel="shortcut icon" href="favicon.ico"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
<link rel="stylesheet" type="text/css" href="styles.css"/> | ||
{{.page._highlight}} | ||
</head> | ||
<# | ||
# Document body | ||
#> | ||
<body class="#container"> | ||
<%include blocks/header/markup.html>& | ||
<%ifndef BODY_BLOCK>& | ||
<%error Descendent layout must define BODY_BLOCK macro> | ||
<%else>& | ||
<%call BODY_BLOCK> | ||
<%endif>& | ||
<%include blocks/footer/markup.html>& | ||
<%partial analytics 'UA-82432866-1'>& | ||
</body> | ||
</html> | ||
<# | ||
vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html | ||
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<# Default node #>& | ||
<# | ||
# Main page block for content | ||
#>& | ||
<%define BODY_BLOCK | ||
<%include blocks/body/markup.html> | ||
>& | ||
<# | ||
# Inherit default layout | ||
#>& | ||
<%include blocks/default.html>& | ||
<# | ||
vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=perl | ||
#>& |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,14 @@ | ||
<# Top-level page markup #>& | ||
<!DOCTYPE html> | ||
<!-- this document uses polyglot markup (well formed XHTML5) --> | ||
<html id="{{.page._id}}" xmlns="http://www.w3.org/1999/xhtml" lang="{{.page.lang//.site.lang}}" xml:lang="{{.page.lang//.site.lang}}"> | ||
<head> | ||
<# Default page #>& | ||
<# | ||
# Meta elements | ||
#> | ||
<meta charset="utf-8" /> | ||
<# Document title and related metadata #> | ||
<title>jqt · {{.page.title}}</title> | ||
<meta name='description' content='{{.page.description//empty}}' /> | ||
<meta name='keywords' content='{{.page.keywords//empty}}' /> | ||
<meta name='author' content='{{[(.page.author//.site.author)[].name] | sort[]}}' /> | ||
<# More metadata #> | ||
<meta name="generator" content="jqt v<%include ../VERSION>" /> | ||
<meta name='dcterms.date' content='{{.page.updated//empty}}' /> | ||
<# Presentation #> | ||
<link rel="shortcut icon" href="favicon.ico"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | ||
<link rel="stylesheet" type="text/css" href="styles.css"/> | ||
{{.page._highlight}} | ||
</head> | ||
# Main page block for content | ||
#>& | ||
<%define BODY_BLOCK | ||
<%include blocks/body/markup.html> | ||
>& | ||
<# | ||
# Document body | ||
#> | ||
<body class="#container"> | ||
<%include blocks/header/markup.html>& | ||
<%ifndef BODY_BLOCK>& | ||
<%include blocks/body/markup.html>& | ||
<%else>& | ||
<%call BODY_BLOCK> | ||
<%endif>& | ||
<%include blocks/footer/markup.html>& | ||
<%partial analytics 'UA-82432866-1'>& | ||
</body> | ||
</html> | ||
# Inherit default layout | ||
#>& | ||
<%include blocks/default.html>& | ||
<# | ||
vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html | ||
#> | ||
vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=perl | ||
#>& |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.