-
-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Labels
Description
Importing CDN assets, it often needs the @x.x.x format for specifying the version. So I want to pass the asset version to locals without @, and use @{{ }} syntax in html.
like this:
postHtml(
expressions({
locals: {
foundationVersion: '6.6.3',
},
}),
).process(`
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@{{ foundationVersion }}/dist/css/foundation.min.css">
<script src="https://cdn.jsdelivr.net/npm/foundation-sites@{{ foundationVersion }}/dist/js/foundation.min.js"></script>
`);It outputs:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites{{ foundationVersion }}/dist/css/foundation.min.css">
<script src="https://cdn.jsdelivr.net/npm/foundation-sites{{ foundationVersion }}/dist/js/foundation.min.js"></script>
This is invalid CDN path.
So currently, it must move @ to locals for all CDN assets. I think it would be great if there is a option to disable @{{ }}.