From f5355df850ff5abb2e184f74f3acc1bd193d5d72 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 13:29:31 -0800 Subject: Fix template to include either the page name or a title for the title tag --- docs/tutorials/wiki/definingviews.rst | 2 +- docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt | 2 +- docs/tutorials/wiki/src/authorization/tutorial/views/default.py | 1 + docs/tutorials/wiki/src/views/tutorial/templates/layout.pt | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index 81ef4f5c4..bd8dc6ecf 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -290,7 +290,7 @@ We can do this via :term:`METAL` macros and slots. - The cookiecutter defined a macro named ``layout`` (line 1). This macro consists of the entire template. -- We changed the ``title`` tag to use the ``name`` attribute of a ``page`` object (lines 11-12). +- We changed the ``title`` tag to use the ``name`` attribute of a ``page`` object, or if it does not exist then the page title (lines 11-12). - The cookiecutter defined a macro customization point or `slot` (line 36). This slot is inside the macro ``layout``. Therefore it can be replaced by content, customizing the macro. diff --git a/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt index ba40fd6f4..b606e8dad 100644 --- a/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt @@ -8,7 +8,7 @@ - ${page.__name__} - Pyramid tutorial wiki (based on + <title><span tal:replace="page.__name__ | title"></span> - Pyramid tutorial wiki (based on TurboGears 20-Minute Wiki) diff --git a/docs/tutorials/wiki/src/authorization/tutorial/views/default.py b/docs/tutorials/wiki/src/authorization/tutorial/views/default.py index a44aca786..0725f7660 100644 --- a/docs/tutorials/wiki/src/authorization/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/authorization/tutorial/views/default.py @@ -106,6 +106,7 @@ def login(request): came_from=came_from, login=login, password=password, + title='Login', ) diff --git a/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt index ba40fd6f4..b606e8dad 100644 --- a/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt @@ -8,7 +8,7 @@ - ${page.__name__} - Pyramid tutorial wiki (based on + <title><span tal:replace="page.__name__ | title"></span> - Pyramid tutorial wiki (based on TurboGears 20-Minute Wiki) -- cgit v1.2.3