0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Refactored site url data attribute for new members script

refs https://github.com/TryGhost/members.js/issues/54

- Previously new meta tag was added which defined the site url which was used by new script
- Removes meta tag and instead directly uses a data attribute defined on script tag which it can read on load, making it much simpler
This commit is contained in:
Rish 2020-06-22 17:27:12 +05:30 committed by Rishabh Garg
parent 1ebbe4ea54
commit a86878ab8f

View file

@ -47,9 +47,7 @@ function getMembersHelper() {
let membersHelper = `<script defer src="${getAssetUrl('public/members.js', true)}"></script>`;
if (config.get('enableDeveloperExperiments')) {
const siteUrl = urlUtils.getSiteUrl().replace(/\/$/, '');
membersHelper = `<meta name="ghost:site" content='${siteUrl}' />`;
membersHelper += `<script defer src="https://unpkg.com/@tryghost/members-js@latest/umd/members.min.js"></script>`;
membersHelper += `<script defer src="https://unpkg.com/@tryghost/members-js@latest/umd/members.min.js" data-ghost="${urlUtils.getSiteUrl()}"></script>`;
}
if ((!!stripeSecretToken && !!stripePublicToken) || !!stripeConnectIntegration.account_id) {
membersHelper += '<script src="https://js.stripe.com/v3/"></script>';