Skip to content
Permalink
Browse files
Merge pull request #2545 from getnikola/passing-url-type-to-context
Passing url_type into template context.
  • Loading branch information
felixfontein committed Oct 23, 2016
2 parents 223bb2a + 6c5944a commit fd273fd4f50a81ef43abb33c0bfd955620016cf7
@@ -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
=============
@@ -60,7 +60,7 @@ lang="{{ lang }}">
{% if use_cdn %}
<!--[if lt IE 9]><script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
{% else %}
<!--[if lt IE 9]><script src="{{ url_replacer(permalink, '/assets/js/html5.js', lang) }}"></script><![endif]-->
<!--[if lt IE 9]><script src="{{ url_replacer(permalink, '/assets/js/html5.js', lang, url_type) }}"></script><![endif]-->
{% endif %}

{{ extra_head_data }}
@@ -60,7 +60,7 @@ lang="${lang}">
%if use_cdn:
<!--[if lt IE 9]><script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
%else:
<!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang)}"></script><![endif]-->
<!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang, url_type)}"></script><![endif]-->
%endif

${extra_head_data}
@@ -65,7 +65,7 @@ lang="{{ lang }}">
{% if use_cdn %}
<!--[if lt IE 9]><script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
{% else %}
<!--[if lt IE 9]><script src="{{ url_replacer(permalink, '/assets/js/html5.js', lang) }}"></script><![endif]-->
<!--[if lt IE 9]><script src="{{ url_replacer(permalink, '/assets/js/html5.js', lang, url_type) }}"></script><![endif]-->
{% endif %}

{{ extra_head_data }}
@@ -65,7 +65,7 @@ lang="${lang}">
%if use_cdn:
<!--[if lt IE 9]><script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
%else:
<!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang)}"></script><![endif]-->
<!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang, url_type)}"></script><![endif]-->
%endif

${extra_head_data}
@@ -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():

0 comments on commit fd273fd

Please sign in to comment.