grim/hgwebplus

Parents 1e9c6759d873
Children bd05e19fda64
Remove the default from title and add a sub_title template keyword
--- a/ChangeLog Sun May 17 06:16:30 2020 -0500
+++ b/ChangeLog Sun May 17 17:09:39 2020 -0500
@@ -1,5 +1,7 @@
0.5.1:
- * Nothing yet, be the first!!
+ * Removed the default value from title so themes can control the default
+ value.
+ * Added sub_title template keyword to output the value of web.sub_title.
0.5.0: (2020-05-17)
* Switched to mistune for markdown rendering to fix images. Fixes
--- a/src/hgwebplus.py Sun May 17 06:16:30 2020 -0500
+++ b/src/hgwebplus.py Sun May 17 17:09:39 2020 -0500
@@ -308,14 +308,25 @@
return ui.config(b'web', b'ssh_clone_url', b'')
-def title(context, mapping):
- """ title is a template keyword that outputs the configuration value of
- `web.title`. It defaults to `Mercurial Repositories`.
+def sub_title(context, mapping):
+ """ sub_title is a template keyword that outputs the configuration value of
+ `web.sub_title`. Themes can use this as a secondary text to the title.
"""
ui = context.resource(mapping, b'ui')
- return ui.config(b'web', b'title', b'Mercurial Repositories')
+ return ui.config(b'web', b'sub_title', b'')
+
+
+def title(context, mapping):
+ """ title is a template keyword that outputs the configuration value of
+ `web.title`. Themes can use this as the HTML title and else where on
+ the pages.
+ """
+
+ ui = context.resource(mapping, b'ui')
+
+ return ui.config(b'web', b'title', b'')
def repo_custom_templater(orig, self, req):
@@ -331,6 +342,7 @@
templatekeyword(b'http_clone_url', requires={b'ui'})(http_clone_url)
templatekeyword(b'readme', requires={b'ctx', b'repo'})(readme)
templatekeyword(b'ssh_clone_url', requires={b'ui'})(ssh_clone_url)
+ templatekeyword(b'sub_title', requires={b'ui'})(sub_title)
templatekeyword(b'title', requires={b'ui'})(title)
return templater