diff --git a/CHANGES.txt b/CHANGES.txt index 3a3943ba69..57b4fe0cee 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,6 +13,7 @@ Features * The destination folder in ``POSTS`` and ``PAGES`` can now be translated (Issue #2116) * Pass ``post`` object and ``lang`` to post compilers (Issue #2531) +* Pass ``url_type`` into template's context. New in v7.8.1 ============= diff --git a/nikola/data/themes/base-jinja/templates/base_helper.tmpl b/nikola/data/themes/base-jinja/templates/base_helper.tmpl index 04f49fe820..8ec2d8defa 100644 --- a/nikola/data/themes/base-jinja/templates/base_helper.tmpl +++ b/nikola/data/themes/base-jinja/templates/base_helper.tmpl @@ -60,7 +60,7 @@ lang="{{ lang }}"> {% if use_cdn %} {% else %} - + {% endif %} {{ extra_head_data }} diff --git a/nikola/data/themes/base/templates/base_helper.tmpl b/nikola/data/themes/base/templates/base_helper.tmpl index e2ffab2afc..f7d704e7e5 100644 --- a/nikola/data/themes/base/templates/base_helper.tmpl +++ b/nikola/data/themes/base/templates/base_helper.tmpl @@ -60,7 +60,7 @@ lang="${lang}"> %if use_cdn: %else: - + %endif ${extra_head_data} diff --git a/nikola/data/themes/bootstrap3-jinja/templates/base_helper.tmpl b/nikola/data/themes/bootstrap3-jinja/templates/base_helper.tmpl index 1d1802f963..ba41b8899d 100644 --- a/nikola/data/themes/bootstrap3-jinja/templates/base_helper.tmpl +++ b/nikola/data/themes/bootstrap3-jinja/templates/base_helper.tmpl @@ -65,7 +65,7 @@ lang="{{ lang }}"> {% if use_cdn %} {% else %} - + {% endif %} {{ extra_head_data }} diff --git a/nikola/data/themes/bootstrap3/templates/base_helper.tmpl b/nikola/data/themes/bootstrap3/templates/base_helper.tmpl index 20b135b2e2..f07716f71e 100644 --- a/nikola/data/themes/bootstrap3/templates/base_helper.tmpl +++ b/nikola/data/themes/bootstrap3/templates/base_helper.tmpl @@ -65,7 +65,7 @@ lang="${lang}"> %if use_cdn: %else: - + %endif ${extra_head_data} diff --git a/nikola/nikola.py b/nikola/nikola.py index 6887ead770..e6e600d4cf 100644 --- a/nikola/nikola.py +++ b/nikola/nikola.py @@ -1306,6 +1306,7 @@ def render_template(self, template_name, output_name, context, url_type=None): for k in self._GLOBAL_CONTEXT_TRANSLATABLE: local_context[k] = local_context[k](local_context['lang']) local_context['is_rtl'] = local_context['lang'] in LEGAL_VALUES['RTL_LANGUAGES'] + local_context['url_type'] = self.config['URL_TYPE'] if url_type is None else url_type # string, arguments local_context["formatmsg"] = lambda s, *a: s % a for h in local_context['template_hooks'].values():