Skip to content

Commit 5034872

Browse files
rhttimabbott
authored andcommitted
topic page: Use topic name, stream name & archive title as page title.
This should improve search engine indexing.
1 parent 6caeb3e commit 5034872

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/website.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
)
4646

4747

48+
def to_topic_page_head_html(title):
49+
return f'<html>\n<head><meta charset="utf-8"><title>{title}</title></head>\n'
50+
51+
4852
def build_website(
4953
json_root,
5054
md_root,
@@ -237,7 +241,13 @@ def write_topic_messages(
237241
topic_name,
238242
)
239243

240-
outfile.write(page_head_html)
244+
# We use a topic-specific title instead of `page_head_html` to improve
245+
# search engine indexing.
246+
outfile.write(
247+
to_topic_page_head_html(
248+
html.escape(topic_name) + " · " + html.escape(stream_name) + " · " + title
249+
)
250+
)
241251
outfile.write(topic_links)
242252
outfile.write(
243253
f'\n<head><link href="{html.escape(site_url)}/style.css" rel="stylesheet"></head>\n'

0 commit comments

Comments
 (0)