[PATCH hg.sr.ht] Add repo description to summary page title
Export this patch
Makes it easier to find repos in the history of browsers that save titles.
Potentially makes web search engine results more useful.
---
hgsrht/templates/repo.html | 2 +-
hgsrht/templates/summary.html | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/hgsrht/templates/repo.html b/hgsrht/templates/repo.html
index 91c0229..c96fdb5 100644
--- a/hgsrht/templates/repo.html
+++ b/hgsrht/templates/repo.html
@@ -7,7 +7,7 @@
/!\ Mercurial 4.8 or newer is required. /!\
/!\ Alternatively, you can clone the repo with SSH. /!\
-->
- <title>{{owner.canonical_name}}/{{repo.name}} {% if scmpagetitle %}{{scmpagetitle}} {% endif %}- {{cfg("sr.ht", "site-name")}} {{scmname}}</title>
+ <title>{{owner.canonical_name}}/{{repo.name}} {% if scmpagetitle %}{{scmpagetitle}} {% else %}{% block repo_title %}{% endblock %}{% endif %}- {{cfg("sr.ht", "site-name")}} {{scmname}}</title>
{% endblock %}
{% block head %}
diff --git a/hgsrht/templates/summary.html b/hgsrht/templates/summary.html
index 3dd18a4..16091a1 100644
--- a/hgsrht/templates/summary.html
+++ b/hgsrht/templates/summary.html
@@ -1,5 +1,9 @@
{% extends "repo.html" %}
+{% if repo.description %}
+{% block repo_title %}- {{ repo.description }} {% endblock %}
+{% endif %}
+
{% block content %}
{% include "partials/scmsummary.html" %}
{% endblock %}
--
2.39.0
Applied, thanks!