diff --git a/app.py b/app.py index 3f613ab..905ab49 100644 --- a/app.py +++ b/app.py @@ -373,7 +373,7 @@ def md(text, expand_magic=False, toc=True, math=True): extensions.append('markdown_katex') extension_configs['markdown_katex'] = { 'no_inline_svg': True, - 'insert_fonts_css': True + 'insert_fonts_css': not _getconf('site', 'katex_url') } try: return markdown.Markdown(extensions=extensions, extension_configs=extension_configs).convert(text) @@ -446,7 +446,8 @@ def _inject_variables(): 'strong': lambda x:Markup('{0}').format(x), 'app_version': __version__, 'math_version': markdown_katex.__version__ if markdown_katex else None, - 'material_icons_url': _getconf('site', 'material_icons_url') + 'material_icons_url': _getconf('site', 'material_icons_url'), + 'katex_url': _getconf('site', 'katex_url') } @login_manager.user_loader diff --git a/i18n/salvi.en.json b/i18n/salvi.en.json index 3a39f35..02db2f8 100644 --- a/i18n/salvi.en.json +++ b/i18n/salvi.en.json @@ -36,6 +36,9 @@ "username": "Username", "password": "Password", "no-account-sign-up": "Don’t have an account?", - "sign-up": "Sign up" + "sign-up": "Sign up", + "not-found": "Not found", + "not-found-text-1": "The page at", + "not-found-text-2": "does not exist." } } \ No newline at end of file diff --git a/i18n/salvi.it.json b/i18n/salvi.it.json index a746c5c..bd20613 100644 --- a/i18n/salvi.it.json +++ b/i18n/salvi.it.json @@ -34,6 +34,9 @@ "back-to": "Torna a", "login": "Entra", "username": "Nome utente", - "password": "Password" + "password": "Password", + "not-found": "Non trovato", + "not-found-text-1": "La pagina con url", + "not-found-text-2": "non esiste" } } \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index fc6f0a1..f72a183 100644 --- a/templates/base.html +++ b/templates/base.html @@ -12,6 +12,19 @@ {% else %} {% endif %} + {% if math_version and katex_url %} + + + {% endif %} {% block json_info %}{% endblock %}
diff --git a/templates/notfound.html b/templates/notfound.html index 5065bd8..0bd7f79 100644 --- a/templates/notfound.html +++ b/templates/notfound.html @@ -3,7 +3,7 @@ {% block title %}Not found - {{ app_name }}{% endblock %} {% block content %} -The url at {{ request.path }} does not exist.
+{{ T('not-found-text-1')}} {{ request.path }} {{ T('not-found-text-2' )}}.
{% endblock %}