mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
improvement(docs): overhaul docs (#1680)
* improvement(docs): overhaul docs * lint * light mode * more light mode * added llms.txt and llms-full.txt and sitemap * fixed mobile styling and position for zoom in out * finished styling * improvement(docs): overhaul docs * lint * remove dups * renaming components * cleanup
This commit is contained in:
+23
-7
@@ -8,15 +8,31 @@ import type { source } from '@/lib/source'
|
||||
const processor = remark().use(remarkMdx).use(remarkInclude).use(remarkGfm)
|
||||
|
||||
export async function getLLMText(page: InferPageType<typeof source>) {
|
||||
const processed = await processor.process({
|
||||
path: page.data._file.absolutePath,
|
||||
value: page.data.content,
|
||||
})
|
||||
// Skip pages without proper file data
|
||||
if (!page?.data?._file?.absolutePath || !page?.data?.content) {
|
||||
return `# ${page.data.title || 'Untitled'}
|
||||
URL: ${page.url || 'Unknown'}
|
||||
|
||||
return `# ${page.data.title}
|
||||
URL: ${page.url}
|
||||
${page.data.description || 'No description available'}`
|
||||
}
|
||||
|
||||
${page.data.description}
|
||||
try {
|
||||
const processed = await processor.process({
|
||||
path: page.data._file.absolutePath,
|
||||
value: page.data.content,
|
||||
})
|
||||
|
||||
return `# ${page.data.title || 'Untitled'}
|
||||
URL: ${page.url || 'Unknown'}
|
||||
|
||||
${page.data.description || ''}
|
||||
|
||||
${processed.value}`
|
||||
} catch (error) {
|
||||
console.error(`Error processing page ${page.url}:`, error)
|
||||
return `# ${page.data.title || 'Untitled'}
|
||||
URL: ${page.url || 'Unknown'}
|
||||
|
||||
${page.data.description || 'No description available'}`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user