@voicenter-team/nuxt-llms-generator 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/llms-files-generator.mjs +11 -10
- package/dist/module.json +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync } from 'fs';
|
|
2
2
|
import { join, dirname, basename } from 'path';
|
|
3
|
-
import {
|
|
3
|
+
import { slugify } from 'transliteration';
|
|
4
4
|
import Mustache from 'mustache';
|
|
5
5
|
import Anthropic from '@anthropic-ai/sdk';
|
|
6
6
|
import { createHash } from 'crypto';
|
|
@@ -1392,17 +1392,18 @@ class LLMSFilesGenerator {
|
|
|
1392
1392
|
return `Information about ${urlItem.url}`;
|
|
1393
1393
|
}
|
|
1394
1394
|
sanitizeUrlForFilename(url) {
|
|
1395
|
-
if (url === "/")
|
|
1395
|
+
if (!url || url === "/")
|
|
1396
1396
|
return "index";
|
|
1397
|
-
}
|
|
1398
1397
|
let filename = url.replace(/^\//, "").replace(/\/$/, "").replace(/\//g, "-").replace(/--+/g, "-").replace(/^-+|-+$/g, "");
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1398
|
+
filename = slugify(filename, {
|
|
1399
|
+
lowercase: true,
|
|
1400
|
+
separator: "-"
|
|
1401
|
+
});
|
|
1402
|
+
if (!filename)
|
|
1403
|
+
filename = `index-${Date.now()}`;
|
|
1404
|
+
if (/^[.-]/.test(filename))
|
|
1405
|
+
filename = `page-${filename.replace(/^[.-]+/, "")}`;
|
|
1406
|
+
return filename;
|
|
1406
1407
|
}
|
|
1407
1408
|
getLLMSFilePath(fullPath) {
|
|
1408
1409
|
const filename = basename(fullPath);
|
package/dist/module.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voicenter-team/nuxt-llms-generator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Nuxt 3 module for automatically generating AI-optimized documentation files (llms.txt, llms-full.txt, and individual .md files) from Umbraco CMS data using Anthropic's Claude API.",
|
|
5
5
|
"repository": "https://github.com/VoicenterTeam/nuxt-llms-generator",
|
|
6
6
|
"license": "MIT",
|