~sotirisp/qute-gemini

a24ab0f7460918ae34fa1a42744fd3aa979ee1a8 — Sotiris Papatheodorou 9 months ago 5f81a61
Show version at the bottom of pages
1 files changed, 14 insertions(+), 0 deletions(-)

M qute-gemini
M qute-gemini => qute-gemini +14 -0
@@ 19,6 19,8 @@ import urllib.parse
from typing import Tuple


_version = "0.1.0"

_max_redirects = 5

_error_page_template = '''<?xml version="1.0" encoding="UTF-8"?>


@@ 235,6 237,18 @@ def gemtext_to_html(gemtext: str, title: str, url: str) -> str:
        else:
            lines.append("\t\t<p>" + html.escape(line.strip()) + "</p>")
    lines.append("")
    original_url_html = '<a href="' + url + '">' + html.escape(url) + "</a>"
    lines.append("\t<details>")
    lines.append("\t\t<summary>")
    lines.append("\t\t\tContent from " + original_url_html)
    lines.append("\t\t</summary>")
    lines.append("\t\t<dl>")
    lines.append("\t\t\t<dt>Original URL</dt>")
    lines.append("\t\t\t<dd>" + original_url_html + "</dd>")
    lines.append("\t\t\t<dt>Fetched by</dt>")
    lines.append('\t\t\t<dd><a href="https://git.sr.ht/~sotirisp/qute-gemini">qute-gemini ' + str(_version) + "</a></dd>")
    lines.append("\t\t</dl>")
    lines.append("\t</details>")
    lines.append("\t</body>\n")
    lines.append("</html>")
    return "\n".join(lines)