diff --git a/assets/img/zulip.svg b/assets/img/zulip.svg index 5bef7d9a29bd15..440ebb78884c69 100644 --- a/assets/img/zulip.svg +++ b/assets/img/zulip.svg @@ -1,10 +1,18 @@ - + + + + + + diff --git a/lib/html.py b/lib/html.py index ab39575bdc4899..4c2eb693f1783f 100644 --- a/lib/html.py +++ b/lib/html.py @@ -38,8 +38,11 @@ def topic_page_links( topic_url = archive_topic_url(site_url, html_root, sanitized_stream_name, sanitized_topic_name) return f'''\ -

Stream: {stream_name}

-

Topic: {topic_name}

+

+ {stream_name} + > + {topic_name} +


@@ -58,9 +61,8 @@ def format_message( ): msg_id = str(msg['id']) - zulip_link = link_to_zulip( + post_link = zulip_post_url( zulip_url, - zulip_icon_url, stream_id, stream_name, topic_name, @@ -80,32 +82,24 @@ def format_message( anchor = ''.format(msg_id) html = f''' {anchor} -

{zulip_link} {user_name} ({date}):

+

+ {user_name} + ({date} + | Archive): +

{msg_content} ''' return html - -def link_to_zulip( - zulip_url, - zulip_icon_url, - stream_id, - stream_name, - topic_name, - msg_id, - ): - # format a link to the original post where you click on the Zulip icon - # (if it's available) - post_link = zulip_post_url(zulip_url, stream_id, stream_name, topic_name, msg_id) - if zulip_icon_url: - img_tag = f'view this post on Zulip' - else: - img_tag = '' - zulip_link = f'{img_tag}' - return zulip_link - def last_updated_footer(stream_info): last_updated = format_date1(stream_info['time']) date_footer = f'\n

Last updated: {last_updated} UTC

' return date_footer +def homepage_link(site_url, zulip_icon_url): + if zulip_icon_url: + img_tag = f'homepage' + else: + img_tag = '' + homepage_url = f'{img_tag}' + return homepage_url diff --git a/lib/jekyll.py b/lib/jekyll.py index 52909a72df931c..a3a1bbd36cc551 100644 --- a/lib/jekyll.py +++ b/lib/jekyll.py @@ -40,6 +40,7 @@ from .html import ( format_message, + homepage_link, last_updated_footer, topic_page_links, ) @@ -58,7 +59,7 @@ def build_website(json_root, md_root, site_url, html_root, title, zulip_url, zul streams = stream_info['streams'] date_footer = last_updated_footer(stream_info) - write_main_page(md_root, site_url, html_root, title, streams, date_footer) + write_main_page(md_root, site_url, html_root, title, streams, date_footer, zulip_icon_url) write_css(md_root) for stream_name in streams: @@ -74,6 +75,7 @@ def build_website(json_root, md_root, site_url, html_root, title, zulip_url, zul stream_name, stream_data, date_footer, + zulip_icon_url ) for topic_name in topic_data: @@ -94,7 +96,7 @@ def build_website(json_root, md_root, site_url, html_root, title, zulip_url, zul # writes the index page listing all streams. # `streams`: a dict mapping stream names to stream json objects as described in the header. -def write_main_page(md_root, site_url, html_root, title, streams, date_footer): +def write_main_page(md_root, site_url, html_root, title, streams, date_footer, zulip_icon_url): ''' The main page in our website lists streams: @@ -108,12 +110,12 @@ def write_main_page(md_root, site_url, html_root, title, streams, date_footer): write_main_page_header(outfile, html_root, title) content = stream_list_page(streams) - + outfile.write(f'\n{homepage_link(site_url, zulip_icon_url)}\n') outfile.write(content) outfile.write(date_footer) outfile.close() -def write_stream_topics(md_root, site_url, html_root, title, stream_name, stream, date_footer): +def write_stream_topics(md_root, site_url, html_root, title, stream_name, stream, date_footer, zulip_icon_url): ''' A stream page lists all topics for the stream: @@ -135,6 +137,7 @@ def write_stream_topics(md_root, site_url, html_root, title, stream_name, stream content = topic_list_page(stream_name, stream_url, topic_data) + outfile.write(f'\n{homepage_link(site_url, zulip_icon_url)}\n') outfile.write(content) outfile.write(date_footer) outfile.close() @@ -203,6 +206,7 @@ def write_topic_messages( topic_name, ) + outfile.write(f'\n{homepage_link(site_url, zulip_icon_url)}\n') outfile.write(topic_links) outfile.write(f'\n\n') diff --git a/style.css b/style.css index 4d34676ea21ab0..5f08f0158df349 100644 --- a/style.css +++ b/style.css @@ -1 +1,6 @@ .msg { margin-left: 2em; } + +.archive-link-color{ + color: grey; + text-decoration: none; +}