Skip to content

Option to disable @{{ }} #106

@alker0

Description

@alker0

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 @{{ }}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions