Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: add CSS selector-like options to URL parameter tags #749

Closed
johneatmon opened this issue Sep 7, 2022 · 4 comments
Closed
Labels
feature request New feature or request

Comments

@johneatmon
Copy link

  • Maizzle Version: 4.0.2
  • Node.js Version: 18.1.0

Would be sweet if I could tailor the way URL parameters are applied to links like a CSS selector. I don't necessarily want to apply parameters to all URLs in my templates, but would like to apply them only where the href contains example.com.

It would be lush to do something like this in config.js:

module.exports = {
  urlParameters: {
    _options: {
      tags: ['a[href~="example.com"]'],
      qs: {}
    },
    utm_source: 'maizzle',
    utm_medium: 'email',
  }
}
@cossssmin cossssmin added the feature request New feature or request label Sep 18, 2022
@cossssmin
Copy link
Member

Should be possible, will play around with posthtml-match-helper and see what we can do 👍

@cossssmin
Copy link
Member

Added in posthtml-url-parameters@1.1.0, will be available in the next Maizzle feature release. Thanks!

@johneatmon
Copy link
Author

You are amazing, thank you @cossssmin!

@cossssmin
Copy link
Member

Released in 4.1.0, feel free to reopen if you spot any issues. Thanks!

https://github.com/maizzle/framework/releases/tag/v4.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants