use request path as an alternative to Title metadata

This commit is contained in:
2021-02-20 22:43:42 -06:00
parent 1cef3b8196
commit 15c88d920b
4 changed files with 24 additions and 4 deletions

View File

@@ -44,7 +44,11 @@ def display_page(path):
parent_navs = generate_parent_navs(resolved_path)
return render('base.html', title=get_meta_str(md, 'title'), description=get_meta_str(md, 'description'),
page_title = (get_meta_str(md, 'title') if md.Meta.get('title') else
f'/{instance_resource_path_to_request_path(resolved_path)}')
logger.debug("title (potentially derived): %s", page_title)
return render('base.html', title=page_title, description=get_meta_str(md, 'description'),
image=get_meta_str(md, 'image'), base_url=request.base_url, content=content, navs=parent_navs,
mtime=mtime.strftime('%Y-%m-%d %H:%M:%S %Z'))