采取以下示例结构:
{% set paths = {
...
'js': {
...
'jquery': {
'version': '1.7.2',
'cdn': 'https://ajax.googleapis.com/ajax/libs/jquery/{{paths.js.jquery.version}}/jquery.min.js',
'fallback': ....
}
}
}
%}
要访问,我通常会使用类似的东西:
<script src="{{paths.js.jquery.cdn}}"></script>
问题:
插值变量无法识别,您会得到类似...libs/jquery/%7B%7B%paths.js/jquery.version7D%7D/jquery.min.js...
.
我试过了:
'a': 'text{{b}}text'
,'a': {{ ('text' ~ b ~ 'text') }}
,'a': "{{ ('text' ~ b ~ 'text') }}"
,'a': "{{ (['text', b, 'text'] | join }}"
,'a': "{{ (['text', {{b}}, 'text'] | join }}"
- 还有更多我忘记了
我知道属性()
关于它的文档不多,但据我所知,它必须是这样的:
attribute(paths, attribute(js, attribute(jquery, cdn)))
对于一个级别来说会很好,但不是任意级别的深度。如果我有误解,请纠正我attribute()
。