Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 38e57ec

Browse filesBrowse files
committed
feat(nuxt-llms): rewriteLLMSTxt option to disable rewriting paths in llms.txt
1 parent a0763cd commit 38e57ec
Copy full SHA for 38e57ec

2 files changed

+11-2Lines changed: 11 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/features/llms/module.ts‎

Copy file name to clipboardExpand all lines: src/features/llms/module.ts
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ import type { SQLOperator, PageCollections, PageCollectionItemBase } from '@nuxt
3737
declare module 'nuxt-llms' {
3838
interface ModuleOptions {
3939
contentRawMarkdown?: false | {
40+
/**
41+
* Whether to rewrite the LLMs.txt file to use the raw markdown endpoint
42+
* @default true
43+
*/
44+
rewriteLLMSTxt?: boolean
45+
/**
46+
* Whether to exclude specific collections from the raw markdown endpoint
47+
* @default []
48+
*/
4049
excludeCollections?: string[]
4150
}
4251
}
Collapse file

‎src/features/llms/runtime/server/content-llms.plugin.ts‎

Copy file name to clipboardExpand all lines: src/features/llms/runtime/server/content-llms.plugin.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export default defineNitroPlugin((nitroApp: NitroApp) => {
9191
}
9292

9393
function getDocumentLink(link: string, collection: string, options: ModuleOptions) {
94-
const contentRawMarkdown = (options as unknown as { contentRawMarkdown: false | { excludeCollections: string[] } })?.contentRawMarkdown
95-
if (contentRawMarkdown === false || contentRawMarkdown?.excludeCollections?.includes(collection)) {
94+
const contentRawMarkdown = (options as unknown as { contentRawMarkdown: false | { rewriteLLMSTxt: boolean, excludeCollections: string[] } })?.contentRawMarkdown
95+
if (contentRawMarkdown === false || contentRawMarkdown?.rewriteLLMSTxt === false || contentRawMarkdown?.excludeCollections?.includes(collection)) {
9696
return withBase(link, options.domain)
9797
}
9898

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.