--- a/ChangeLog Sun May 17 04:27:45 2020 -0500
+++ b/ChangeLog Sun May 17 05:28:54 2020 -0500
@@ -1,6 +1,8 @@
* Switched to mistune for markdown rendering to fix images. Fixes
+ * Added title template keyword to output the value of web.title. Fixes --- a/README.md Sun May 17 04:27:45 2020 -0500
+++ b/README.md Sun May 17 05:28:54 2020 -0500
@@ -71,6 +71,12 @@
![diffstat example](images/diffstat.png)
+Title is a new tempate keyword that will output the value of the `web.title` +configuration setting. This allows users to customize a title that themes +can then render. It defaults to `Mercurial Repositories`. If you have any issues with this extension, please file them at
--- a/src/hgwebplus.py Sun May 17 04:27:45 2020 -0500
+++ b/src/hgwebplus.py Sun May 17 05:28:54 2020 -0500
@@ -286,6 +286,16 @@
+def title(context, mapping): + """ title is a template keyword that outputs the configuration value of + `web.title`. It defaults to `Mercurial Repositories`. + ui = context.resource(mapping, b'ui') + return ui.config(b'web', b'title', b'Mercurial Repositories') def repo_custom_templater(orig, self, req):
""" this function is a wrapper of hgweb_mod.requestcontext.templater. This
is done to be able to add custom keywords into hgweb. This is not an
@@ -297,6 +307,7 @@
templatekeyword = registrar.templatekeyword(templater._proc._defaults)
templatekeyword(b'readme', requires={b'ctx', b'repo'})(readme)
+ templatekeyword(b'title', requires={b'ui'})(title)