swup/swupjs

Blacklist a class?

spqrdaze opened this issue · 1 comments

Hi,

First of all, thank you for this amazing library. I'm working on a new project using it and it's going great.

I would have one question, is it possible to blacklist a href by using a class or id on it?

for example <a id="dontswup" href="/test">clickme</a>

I don't want swup to activate when he sees the id "dontswup"

If not how can i solve this ?

I figured it out ! It was in the documentation.

All i had to do was add this as in documentation

const options = { linkSelector: 'a[href^="' + window.location.origin + '"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup]), a[href^="#"]:not([data-no-swup])' };

and this to my a href <a data-no-swup href="/test">clickme</a>