Skip to content

Custom header/footer fails on topic pages? #79

Open
@jmandel

Description

@jmandel

From

# We use a topic-specific title instead of `page_head_html` to improve
# search engine indexing.
outfile.write(
to_topic_page_head_html(
html.escape(topic_name) + " · " + html.escape(stream_name) + " · " + title
)
)
outfile.write(topic_links)
outfile.write(
f'\n<head><link href="{html.escape(site_url)}/style.css" rel="stylesheet"></head>\n'
)
for msg in messages:
msg_html = format_message_html(
site_url,
html_root,
zulip_url,
zulip_icon_url,
stream_name,
stream_id,
topic_name,
msg,
)
outfile.write(msg_html)
outfile.write("\n\n")
outfile.write(date_footer_html)
outfile.write(page_footer_html)

... it looks like on topic pages the custom header HTML isn't used, but custom footer HTML is used. This means

  1. Broken tags if the customer header opens things like a div and the custom footer closes them -- since the tag will be closed without having been opened on topic pages
  2. Custom styling is lost on topic pages

Would be good to support some basic string interpolation in the custom header to allow topics to appear (or if this is out of scope: only apply the hard-coded HTML if no custom HTML header has been passed in).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions