mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added new meta tag for site url behind dev flag (#11906)
refs TryGhost/members.js#39 Currently, there is no way to determine exact Ghost site url from a theme, which is used by new members.js to initialize the script and use members/admin API. This change - adds a new meta tag - `ghost:site` with value as ghost site url, when members is enabled - new meta tag is behind dev flag along with members.js script
This commit is contained in:
parent
f4d9a41d3b
commit
3fe3814cf0
1 changed files with 4 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
|||
// Usage: `{{ghost_head}}`
|
||||
//
|
||||
// Outputs scripts and other assets at the top of a Ghost theme
|
||||
const {metaData, escapeExpression, SafeString, logging, settingsCache, config, blogIcon, labs} = require('../services/proxy');
|
||||
const {metaData, escapeExpression, SafeString, logging, settingsCache, config, blogIcon, labs, urlUtils} = require('../services/proxy');
|
||||
const _ = require('lodash');
|
||||
const debug = require('ghost-ignition').debug('ghost_head');
|
||||
|
||||
|
@ -47,7 +47,9 @@ function getMembersHelper() {
|
|||
|
||||
let membersHelper = `<script defer src="${getAssetUrl('public/members.js', true)}"></script>`;
|
||||
if (config.get('enableDeveloperExperiments')) {
|
||||
membersHelper = `<script defer src="https://unpkg.com/@tryghost/members-js@latest/umd/members.min.js"></script>`;
|
||||
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>`;
|
||||
}
|
||||
if ((!!stripeSecretToken && !!stripePublicToken) || !!stripeConnectIntegration.account_id) {
|
||||
membersHelper += '<script src="https://js.stripe.com/v3/"></script>';
|
||||
|
|
Loading…
Add table
Reference in a new issue