Skip to content

Commit e15dbef

Browse files
committed
fix: set <title> for blame pages about, syntax, help, draft, and 404 pages
This is a follow up to #485.
1 parent dc7dc4a commit e15dbef

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

otterwiki/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def about():
116116
htmlcontent, _, library_requirements = render.markdown(content)
117117
return render_template(
118118
"about.html",
119+
title="About",
119120
htmlcontent=htmlcontent,
120121
__version__=__version__,
121122
library_requirements=library_requirements,
@@ -126,6 +127,7 @@ def about():
126127
def syntax():
127128
return render_template(
128129
"syntax.html",
130+
title="Syntax",
129131
in_help=True,
130132
pagepath="",
131133
)
@@ -167,6 +169,7 @@ def help(topic=None):
167169
)
168170
return render_template(
169171
"help_syntax.html",
172+
title="Help - Syntax",
170173
toc=toc,
171174
in_help=True,
172175
embedding_info=embedding_info,
@@ -185,6 +188,7 @@ def help(topic=None):
185188
# default help
186189
return render_template(
187190
"help.html",
191+
title="Help - {}".format(topic.capitalize()) if topic else "Help",
188192
content=content,
189193
toc=toc,
190194
library_requirements=library_requirements,

otterwiki/wiki.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ def exists_or_404(self, in_git: bool = False):
448448
response404 = make_response(
449449
render_template(
450450
"page404.html",
451+
title="{} - not found".format(self.pagename_full),
451452
pagename=self.pagename_full,
452453
pagepath=self.pagepath,
453454
),
@@ -734,6 +735,7 @@ def editor(self, author, handle_draft=None):
734735
if handle_draft is None:
735736
return render_template(
736737
"draft.html",
738+
title="{} - draft".format(self.pagename),
737739
pagename=self.pagename,
738740
pagepath=self.pagepath,
739741
revision=(
@@ -894,9 +896,12 @@ def blame(self):
894896
)
895897
fdata[last_index][8] += 1
896898
menutree = SidebarPageIndex(self.pagepath)
899+
title = "{} - blame".format(self.pagename)
900+
if self.revision is not None:
901+
title = "{} ({})".format(title, self.revision)
897902
return render_template(
898903
"blame.html",
899-
title="{} - blame {}".format(self.pagename, self.revision),
904+
title=title,
900905
pagepath=self.pagepath,
901906
pagename=self.pagename,
902907
blame=fdata,

0 commit comments

Comments
 (0)