From cbd62c2dfa9bd8d04480d67b557a6fc326e532ca Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Thu, 2 Dec 2021 12:51:25 +1300 Subject: Validator links no longer use referer, tag templates now use macros --- project/context/general.json | 6 +++++ project/templates/about.xhtml | 4 +++ project/templates/adapad.xhtml | 4 +++ project/templates/base_math.xhtml | 11 ++++---- project/templates/base_plain.xhtml | 9 ++++--- project/templates/deckconv.xhtml | 4 +++ project/templates/fltkada.xhtml | 4 +++ project/templates/grasp.xhtml | 4 +++ project/templates/index.xhtml | 4 +++ project/templates/integral.xhtml | 4 +++ project/templates/links.xhtml | 4 +++ project/templates/packrat.xhtml | 4 +++ project/templates/sokoban.xhtml | 4 +++ project/templates/steelman.xhtml | 4 +++ project/templates/stvcount.xhtml | 4 +++ project/templates/sunset.xhtml | 4 +++ project/templates/sydneyrail.xhtml | 4 +++ project/templates/tags.xhtml | 4 +++ project/templates/tags/application.xhtml | 30 +++------------------- project/templates/tags/base_tag.xhtml | 43 ++++++++++++++++++++++++++++++++ project/templates/tags/binding.xhtml | 30 +++------------------- project/templates/tags/compsci.xhtml | 30 +++------------------- project/templates/tags/copyright.xhtml | 30 +++------------------- project/templates/tags/esoteric.xhtml | 30 +++------------------- project/templates/tags/language.xhtml | 30 +++------------------- project/templates/tags/legal.xhtml | 30 +++------------------- project/templates/tags/library.xhtml | 30 +++------------------- project/templates/tags/maps.xhtml | 30 +++------------------- project/templates/tags/mathematics.xhtml | 30 +++------------------- project/templates/tags/politics.xhtml | 30 +++------------------- project/templates/tags/programming.xhtml | 30 +++------------------- project/templates/tags/transport.xhtml | 30 +++------------------- project/templates/tags/videogames.xhtml | 30 +++------------------- project/templates/thue2a.xhtml | 4 +++ 34 files changed, 180 insertions(+), 373 deletions(-) create mode 100644 project/context/general.json create mode 100644 project/templates/tags/base_tag.xhtml diff --git a/project/context/general.json b/project/context/general.json new file mode 100644 index 0000000..be61925 --- /dev/null +++ b/project/context/general.json @@ -0,0 +1,6 @@ + +{ + "baseurl": "http://jedbarber.id.au" +} + + diff --git a/project/templates/about.xhtml b/project/templates/about.xhtml index a982b0d..e710323 100644 --- a/project/templates/about.xhtml +++ b/project/templates/about.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("about.xhtml") }}{%- endblock -%} + + + {%- block style %} {% endblock -%} diff --git a/project/templates/adapad.xhtml b/project/templates/adapad.xhtml index 7028db5..a87169a 100644 --- a/project/templates/adapad.xhtml +++ b/project/templates/adapad.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("adapad.xhtml") }}{%- endblock -%} + + + {%- block content %}

Adapad

diff --git a/project/templates/base_math.xhtml b/project/templates/base_math.xhtml index 834c116..145f679 100644 --- a/project/templates/base_math.xhtml +++ b/project/templates/base_math.xhtml @@ -12,25 +12,26 @@ -{%- block footer %} - +{%- macro math_footer(anchor) %} + {%- set linkto = general.baseurl ~ "/" ~ anchor %} + Valid XHTML 1.1 - + Valid MathML 2.0 - + Valid CSS -{%- endblock -%} +{%- endmacro -%} diff --git a/project/templates/base_plain.xhtml b/project/templates/base_plain.xhtml index 454cc0e..b5e2da5 100644 --- a/project/templates/base_plain.xhtml +++ b/project/templates/base_plain.xhtml @@ -12,19 +12,20 @@ -{%- block footer %} - +{%- macro plain_footer(anchor) %} + {%- set linkto = general.baseurl ~ "/" ~ anchor %} + Valid XHTML 1.1 - + Valid CSS -{%- endblock -%} +{%- endmacro -%} diff --git a/project/templates/deckconv.xhtml b/project/templates/deckconv.xhtml index d02afc2..7424fff 100644 --- a/project/templates/deckconv.xhtml +++ b/project/templates/deckconv.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("deckconv.xhtml") }}{%- endblock -%} + + + {%- block content %}

Flashcard Deck Converter

diff --git a/project/templates/fltkada.xhtml b/project/templates/fltkada.xhtml index fbc4a7b..4a4a85f 100644 --- a/project/templates/fltkada.xhtml +++ b/project/templates/fltkada.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("fltkada.xhtml") }}{%- endblock -%} + + + {%- block content %}

FLTK Ada Binding

diff --git a/project/templates/grasp.xhtml b/project/templates/grasp.xhtml index e6deb41..5d8d237 100644 --- a/project/templates/grasp.xhtml +++ b/project/templates/grasp.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("grasp.xhtml") }}{%- endblock -%} + + + {%- block content %}

Grasp Interpreter

diff --git a/project/templates/index.xhtml b/project/templates/index.xhtml index 09bc559..ef76465 100644 --- a/project/templates/index.xhtml +++ b/project/templates/index.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("index.xhtml") }}{%- endblock -%} + + + {%- block style %} {% endblock -%} diff --git a/project/templates/integral.xhtml b/project/templates/integral.xhtml index 8f2f33a..364ef0a 100644 --- a/project/templates/integral.xhtml +++ b/project/templates/integral.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ math_footer ("integral.xhtml") }}{%- endblock -%} + + + {%- block style %} {% endblock -%} diff --git a/project/templates/links.xhtml b/project/templates/links.xhtml index 5be9deb..23ec904 100644 --- a/project/templates/links.xhtml +++ b/project/templates/links.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("links.xhtml") }}{%- endblock -%} + + + {%- block style %} {% endblock -%} diff --git a/project/templates/packrat.xhtml b/project/templates/packrat.xhtml index defc9e8..0d1c2b7 100644 --- a/project/templates/packrat.xhtml +++ b/project/templates/packrat.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("packrat.xhtml") }}{%- endblock -%} + + + {%- block content %}

Packrat Parser Combinator Library

diff --git a/project/templates/sokoban.xhtml b/project/templates/sokoban.xhtml index 5c08184..2d92bb4 100644 --- a/project/templates/sokoban.xhtml +++ b/project/templates/sokoban.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("sokoban.xhtml") }}{%- endblock -%} + + + {%- block content %}

Sokoban Clone

diff --git a/project/templates/steelman.xhtml b/project/templates/steelman.xhtml index f724171..94a7721 100644 --- a/project/templates/steelman.xhtml +++ b/project/templates/steelman.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("steelman.xhtml") }}{%- endblock -%} + + + {%- block style %} {% endblock -%} diff --git a/project/templates/stvcount.xhtml b/project/templates/stvcount.xhtml index e475692..cd0aca2 100644 --- a/project/templates/stvcount.xhtml +++ b/project/templates/stvcount.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("stvcount.xhtml") }}{%- endblock -%} + + + {%- block style %} {% endblock -%} diff --git a/project/templates/sunset.xhtml b/project/templates/sunset.xhtml index 765f570..2cde6b2 100644 --- a/project/templates/sunset.xhtml +++ b/project/templates/sunset.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("sunset.xhtml") }}{%- endblock -%} + + + {%- block content %}

Sunset License

diff --git a/project/templates/sydneyrail.xhtml b/project/templates/sydneyrail.xhtml index de23d31..e15a1a0 100644 --- a/project/templates/sydneyrail.xhtml +++ b/project/templates/sydneyrail.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("sydneyrail.xhtml") }}{%- endblock -%} + + + {%- block content %}

Sydney Rail Maps

diff --git a/project/templates/tags.xhtml b/project/templates/tags.xhtml index b9e835a..f92c822 100644 --- a/project/templates/tags.xhtml +++ b/project/templates/tags.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("tags.xhtml") }}{%- endblock -%} + + + {%- block style %} {% endblock -%} diff --git a/project/templates/tags/application.xhtml b/project/templates/tags/application.xhtml index 82c2a5f..421fa20 100644 --- a/project/templates/tags/application.xhtml +++ b/project/templates/tags/application.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Application Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Application

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Application") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Application") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("application.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/base_tag.xhtml b/project/templates/tags/base_tag.xhtml new file mode 100644 index 0000000..a2c8b9f --- /dev/null +++ b/project/templates/tags/base_tag.xhtml @@ -0,0 +1,43 @@ + +{%- extends "base_plain.xhtml" -%} + + + +{%- macro tag_title(label) -%}{{ label | capitalize }} Tag{%- endmacro -%} + + + +{%- block style %} + +{% endblock -%} + + + +{%- macro tag_content(label) %} +

Tag: {{ label | capitalize }}

+ + +{% endmacro -%} + + + +{%- macro tag_footer(anchor) -%} + {{ plain_footer ('tags/' ~ anchor) }} +{%- endmacro -%} + + diff --git a/project/templates/tags/binding.xhtml b/project/templates/tags/binding.xhtml index 794e595..b27a954 100644 --- a/project/templates/tags/binding.xhtml +++ b/project/templates/tags/binding.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Binding Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Binding

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Binding") }}{%- endblock -%} +{%- block content -%}{{ tag_content ("Binding") }}{%- endblock -%} +{%- block footer -%}{{ tag_footer ("binding.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/compsci.xhtml b/project/templates/tags/compsci.xhtml index 741cf51..cf2160b 100644 --- a/project/templates/tags/compsci.xhtml +++ b/project/templates/tags/compsci.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Compsci Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Compsci

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Compsci") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Compsci") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("compsci.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/copyright.xhtml b/project/templates/tags/copyright.xhtml index dfe6295..d37a6e3 100644 --- a/project/templates/tags/copyright.xhtml +++ b/project/templates/tags/copyright.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Copyright Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Copyright

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Copyright") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Copyright") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("copyright.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/esoteric.xhtml b/project/templates/tags/esoteric.xhtml index 917851c..015c0c2 100644 --- a/project/templates/tags/esoteric.xhtml +++ b/project/templates/tags/esoteric.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Esoteric Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Esoteric

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Esoteric") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Esoteric") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("esoteric.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/language.xhtml b/project/templates/tags/language.xhtml index 7669da9..801ed77 100644 --- a/project/templates/tags/language.xhtml +++ b/project/templates/tags/language.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Language Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Language

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Language") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Language") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("language.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/legal.xhtml b/project/templates/tags/legal.xhtml index 1d97d7a..109e751 100644 --- a/project/templates/tags/legal.xhtml +++ b/project/templates/tags/legal.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Legal Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Legal

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Legal") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Legal") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("legal.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/library.xhtml b/project/templates/tags/library.xhtml index 3f9c2fc..e3a47c5 100644 --- a/project/templates/tags/library.xhtml +++ b/project/templates/tags/library.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Library Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Library

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Library") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Library") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("library.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/maps.xhtml b/project/templates/tags/maps.xhtml index 8fe15e5..c61e928 100644 --- a/project/templates/tags/maps.xhtml +++ b/project/templates/tags/maps.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Maps Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Maps

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Maps") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Maps") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("maps.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/mathematics.xhtml b/project/templates/tags/mathematics.xhtml index 4441004..38a0022 100644 --- a/project/templates/tags/mathematics.xhtml +++ b/project/templates/tags/mathematics.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Mathematics Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Mathematics

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Mathematics") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Mathematics") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("mathematics.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/politics.xhtml b/project/templates/tags/politics.xhtml index 7cc490f..15fd2a9 100644 --- a/project/templates/tags/politics.xhtml +++ b/project/templates/tags/politics.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Politics Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Politics

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Politics") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Politics") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("politics.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/programming.xhtml b/project/templates/tags/programming.xhtml index d4ca315..d5a0035 100644 --- a/project/templates/tags/programming.xhtml +++ b/project/templates/tags/programming.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Programming Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Programming

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Programming") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Programming") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("programming.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/transport.xhtml b/project/templates/tags/transport.xhtml index 0881d37..d5d3c3c 100644 --- a/project/templates/tags/transport.xhtml +++ b/project/templates/tags/transport.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Transport Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Transport

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Transport") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Transport") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("transport.xhtml") }}{%- endblock -%} diff --git a/project/templates/tags/videogames.xhtml b/project/templates/tags/videogames.xhtml index ea820a8..2f87308 100644 --- a/project/templates/tags/videogames.xhtml +++ b/project/templates/tags/videogames.xhtml @@ -1,32 +1,10 @@ -{%- extends "base_plain.xhtml" -%} +{%- extends "tags/base_tag.xhtml" -%} -{%- block title -%}Videogames Tag{%- endblock -%} - - - -{%- block style %} - -{% endblock -%} - - - -{%- block content %} -

Tag: Videogames

- - -{% endblock -%} +{%- block title -%}{{ tag_title ("Videogames") }}{%- endblock -%} +{%- block content %}{{ tag_content ("Videogames") }}{% endblock -%} +{%- block footer -%}{{ tag_footer ("videogames.xhtml") }}{%- endblock -%} diff --git a/project/templates/thue2a.xhtml b/project/templates/thue2a.xhtml index 03d1fe7..3e035e1 100644 --- a/project/templates/thue2a.xhtml +++ b/project/templates/thue2a.xhtml @@ -7,6 +7,10 @@ +{%- block footer -%}{{ plain_footer ("thue2a.xhtml") }}{%- endblock -%} + + + {%- block content %}

Thue Version 2a

-- cgit