diff --git a/ietf/meeting/views.py b/ietf/meeting/views.py index c23569f0b..3e7b89d58 100644 --- a/ietf/meeting/views.py +++ b/ietf/meeting/views.py @@ -279,15 +279,21 @@ def materials_document(request, document, num=None, ext=None): if len(file_ext) == 2 and file_ext[1] == '.md' and mtype == 'text/plain': sorted_accept = sort_accept_tuple(request.META.get('HTTP_ACCEPT')) for atype in sorted_accept: - if atype[0] == 'text/markdown': - content_type = content_type.replace('plain', 'markdown', 1) - break; - elif atype[0] == 'text/html': - bytes = "\n\n\n%s\n\n\n" % markdown.markdown(bytes.decode(encoding=chset)) - content_type = content_type.replace('plain', 'html', 1) - break; - elif atype[0] == 'text/plain': - break; + if atype[0] == "text/markdown": + content_type = content_type.replace("plain", "markdown", 1) + break + elif atype[0] == "text/html": + bytes = render_to_string( + "minimal.html", + { + "content": markdown.markdown(bytes.decode(encoding=chset)), + "title": basename, + }, + ) + content_type = content_type.replace("plain", "html", 1) + break + elif atype[0] == "text/plain": + break response = HttpResponse(bytes, content_type=content_type) response['Content-Disposition'] = 'inline; filename="%s"' % basename diff --git a/ietf/static/css/ietf.scss b/ietf/static/css/ietf.scss index 2e2127990..ca960c037 100644 --- a/ietf/static/css/ietf.scss +++ b/ietf/static/css/ietf.scss @@ -47,7 +47,7 @@ url("npm:bootstrap-icons/font/fonts/bootstrap-icons.woff") format("woff"); @import "bootstrap-icons/font/bootstrap-icons"; // Leave room for fixed-top navbar... -body { +body.navbar-offset { padding-top: 60px; } diff --git a/ietf/templates/base.html b/ietf/templates/base.html index 77a2fa9d9..bc315dd56 100644 --- a/ietf/templates/base.html +++ b/ietf/templates/base.html @@ -31,7 +31,7 @@ {% analytical_head_bottom %} - {% analytical_body_top %} Skip to main content diff --git a/ietf/templates/minimal.html b/ietf/templates/minimal.html new file mode 100644 index 000000000..87f661f50 --- /dev/null +++ b/ietf/templates/minimal.html @@ -0,0 +1,21 @@ +{# Copyright The IETF Trust 2015-2023, All Rights Reserved #} + +{% load static %} +{% load origin %} +{% origin %} + + + + + {{ title }} + + + + + {# load this in the head, to prevent flickering #} + + + + {{ content }} + + \ No newline at end of file