FriendsOfREDAXO / for_sa11y

REDAXO AddOn sA11y - accessibility check
https://github.com/FriendsOfREDAXO/A11y
MIT License
15 stars 1 forks source link

CDN? #3

Closed adamchaboryk closed 1 year ago

adamchaboryk commented 1 year ago

Feature description / Feature Beschreibung Greetings!

I was just having a look at your integration, and I have a small suggestion. If you'd like to make your add-on easier to update, you can use the CDN instead. That way you don't have to include the dozens of javascript/css files in your repo. Simply update $version.

I have modified the code as an example:

$addon = rex_addon::get('for_sa11y');

      // Just change version number to update.
      $version = 3.0.0;

      $js = '      
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ryersondmp/sa11y@" . $version . "/dist/css/sa11y.min.css"/>
      <script src="https://cdn.jsdelivr.net/gh/ryersondmp/sa11y@" . $version . "/dist/js/sa11y.umd.min.js"></script>
      <script src="https://cdn.jsdelivr.net/gh/ryersondmp/sa11y@" . $version . "/dist/js/lang/" . $lang['js'] . ".umd.js"></script>

      <script>     
        Sa11y.Lang.addI18n(Sa11yLang'.$lang["setup"].'.strings);
        const sa11y = new Sa11y.Sa11y({
          checkRoot: \'body\',
          readabilityLang: \''.$lang["text"].'\',
          containerIgnore: \'.rex-minibar,.consent_manager-wrapper,.sa11y-ignore\',
        });
      </script>';

Cheers

skerbis commented 1 year ago

Thanks for the suggestion. I would really like to do that. But our CMS is mainly used in the EU or Germany and there is unfortunately the GDPR / DSGVo which would then force us to ask for a consent for the use of the cdn. šŸ™„

thanks again for this great solution

We love it šŸ‘ Thomas

adamchaboryk commented 1 year ago

Ooohhhh, that didn't even cross my mind! Interesting... today I learned! Thanks!