feat(mindspace): add SEO/GEO delivery, page template catalog, and admin hooks
Memind CI / Test, build, and release guards (push) Has been cancelled
Memind CI / Test, build, and release guards (push) Has been cancelled
Enable optional SEO/GEO injection and discovery routes for confirmed public pages while keeping private pages noindex. Add premium page template skills, portal catalog API, template shop UI, and Baidu push gated by memind_adm config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -191,6 +191,38 @@ test('decorateMindSpacePublishedHtml supports embed mode without share injection
|
||||
assert.equal(result.csp, JSON.stringify({ embed: true, wechatShare: false, scriptHashes: [] }));
|
||||
});
|
||||
|
||||
test('decorateMindSpacePublishedHtml injects noindex when seo geo enabled for private publication', () => {
|
||||
const result = decorateMindSpacePublishedHtml({
|
||||
html: '<html><head><title>Demo</title></head><body></body></html>',
|
||||
embed: false,
|
||||
seoGeoConfig: {
|
||||
enabled: true,
|
||||
seo: { enabled: true, canonical: true },
|
||||
geo: { enabled: true, jsonLd: true },
|
||||
},
|
||||
publicationSnapshot: {
|
||||
status: 'online',
|
||||
accessMode: 'password',
|
||||
userConfirmedAt: Date.now(),
|
||||
},
|
||||
context: {
|
||||
origin: 'https://m.tkmind.cn',
|
||||
pageUrl: 'https://m.tkmind.cn/u/john/pages/demo',
|
||||
pageDirUrl: 'https://m.tkmind.cn/u/john/pages/',
|
||||
fallbackImageUrl: '',
|
||||
},
|
||||
preparePublicationHtmlForEmbed: (value) => value,
|
||||
injectOgTags: (value) => value,
|
||||
injectWechatShareBridge: (value) => value,
|
||||
injectPublicFileShareButton: (value) => ({ html: value, scriptHashes: [] }),
|
||||
publishedPageCsp: () => 'csp',
|
||||
isWechatUserAgent: () => false,
|
||||
});
|
||||
|
||||
assert.match(result.html, /noindex, nofollow/);
|
||||
assert.equal(result.robotsHeader, 'noindex, nofollow');
|
||||
});
|
||||
|
||||
test('decorateMindSpacePublishedHtml does not break inline scripts containing </body>', () => {
|
||||
const pageScript = "var x='<html><body>'+tb+'</body></html>';";
|
||||
const result = decorateMindSpacePublishedHtml({
|
||||
|
||||
Reference in New Issue
Block a user