fde6503bdf
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>
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import {
|
|
renderLlmsTxt,
|
|
renderRobotsTxt,
|
|
renderSitemapXml,
|
|
} from './mindspace-seo-discovery-service.mjs';
|
|
|
|
test('renderSitemapXml emits only provided urls', () => {
|
|
const xml = renderSitemapXml(
|
|
[{ publicUrl: '/u/john/pages/demo', updatedAt: Date.parse('2026-08-01T00:00:00.000Z') }],
|
|
{ origin: 'https://m.tkmind.cn' },
|
|
);
|
|
assert.match(xml, /<loc>https:\/\/m\.tkmind\.cn\/u\/john\/pages\/demo<\/loc>/);
|
|
});
|
|
|
|
test('renderRobotsTxt references sitemap when enabled', () => {
|
|
const body = renderRobotsTxt({
|
|
origin: 'https://m.tkmind.cn',
|
|
sitemapEnabled: true,
|
|
llmsTxtEnabled: true,
|
|
});
|
|
assert.match(body, /Sitemap: https:\/\/m\.tkmind\.cn\/sitemap\.xml/);
|
|
assert.match(body, /llms\.txt/);
|
|
});
|
|
|
|
test('renderLlmsTxt lists markdown links', () => {
|
|
const body = renderLlmsTxt(
|
|
[{ publicUrl: '/u/john/pages/demo', summary: '仙居玩水' }],
|
|
{ origin: 'https://m.tkmind.cn' },
|
|
);
|
|
assert.match(body, /\[仙居玩水\]\(https:\/\/m\.tkmind\.cn\/u\/john\/pages\/demo\)/);
|
|
});
|