@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.
@@ -1,6 +1,6 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync } from 'fs';
2
2
  import { join, dirname, basename } from 'path';
3
- import { transliterate } from 'transliteration';
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
- if (!filename || filename === "") {
1400
- filename = `index_${url.length}_${Date.now()}`;
1401
- }
1402
- if (filename.startsWith("-") || filename.startsWith(".")) {
1403
- filename = "page-" + filename.replace(/^[-.]/, "");
1404
- }
1405
- return transliterate(filename);
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
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.9"
7
+ "version": "0.1.10"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicenter-team/nuxt-llms-generator",
3
- "version": "0.1.9",
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",