@@ -94,6 +94,7 @@ def get_project_error_page(req, resp, exception: ElixirProjectError):
9494
9595 'referer' : req .referer if req .referer != req .uri else None ,
9696 'bug_report_link' : get_github_issue_link (report_error_details ),
97+ 'home_page_url' : '/' ,
9798 'report_error_details' : report_error_details ,
9899
99100 'error_title' : exception .title ,
@@ -109,25 +110,24 @@ def get_project_error_page(req, resp, exception: ElixirProjectError):
109110 get_url_with_new_version = lambda v : stringify_source_path (project , v , '/' )
110111 versions , current_version_path = get_versions (versions_raw , get_url_with_new_version , version )
111112
113+ if current_version_path [2 ] is None :
114+ # If details about current version are not available, make base links
115+ # point to latest.
116+ # current_tag is not set to latest to avoid latest being highlighted in the sidebar
117+ version = query .query ('latest' )
118+
112119 template_ctx = {
113120 ** template_ctx ,
114121
115122 'current_project' : project ,
123+ 'current_tag' : version ,
116124 'versions' : versions ,
117125 'current_version_path' : current_version_path ,
118- }
119-
120126
121- if version is None :
122- # If details about current version are not available, make base links
123- # point to latest.
124- # current_tag is not set to latest to avoid latest being highlighted in the sidebar
125- version = query .query ('latest' )
126- else :
127- template_ctx ['current_tag' ] = version
128-
129- template_ctx ['source_base_url' ] = get_source_base_url (project , version )
130- template_ctx ['ident_base_url' ] = get_ident_base_url (project , version )
127+ 'home_page_url' : get_source_base_url (project , version ),
128+ 'source_base_url' : get_source_base_url (project , version ),
129+ 'ident_base_url' : get_ident_base_url (project , version ),
130+ }
131131
132132 if exception .description is not None :
133133 template_ctx ['error_details' ] = exception .description
0 commit comments