mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
32 lines
18 KiB
JavaScript
32 lines
18 KiB
JavaScript
import{$ as e,B as t,P as n,_ as r,f as i,g as a,h as o,l as s}from"./runtime-core.esm-bundler-CZvn3YaB.js";import{t as c}from"./plugin-vue_export-helper-CxTVcLa7.js";var l=JSON.parse(`{"path":"/en/config/plugins/llmstxt/","title":"LLMs txt | Config","lang":"en-US","frontmatter":{"title":"LLMs txt","createTime":"2025/11/19 14:48:35","permalink":"/en/config/plugins/llmstxt/","description":"Overview Add llms.txt to your site to provide LLM-friendly content. Related Plugin: @vuepress/plugin-llms Why llms.txt? Large Language Models increasingly rely on website inform...","head":[["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"LLMs txt\\",\\"image\\":[\\"\\"],\\"dateModified\\":\\"2025-11-19T08:51:49.000Z\\",\\"author\\":[]}"],["meta",{"property":"og:url","content":"https://theme-plume.vuejs.press/en/config/plugins/llmstxt/"}],["meta",{"property":"og:site_name","content":"Plume Theme"}],["meta",{"property":"og:title","content":"LLMs txt"}],["meta",{"property":"og:description","content":"Overview Add llms.txt to your site to provide LLM-friendly content. Related Plugin: @vuepress/plugin-llms Why llms.txt? Large Language Models increasingly rely on website inform..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2025-11-19T08:51:49.000Z"}],["meta",{"property":"article:modified_time","content":"2025-11-19T08:51:49.000Z"}],["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://theme-plume.vuejs.press/config/plugins/llmstxt/"}]]},"readingTime":{"minutes":1.69,"words":508},"git":{"createdTime":1763542309000,"updatedTime":1763542309000,"contributors":[{"name":"pengzhanbo","username":"pengzhanbo","email":"volodymyr@foxmail.com","commits":1,"avatar":"https://avatars.githubusercontent.com/pengzhanbo?v=4","url":"https://github.com/pengzhanbo"}],"changelog":[{"hash":"20728f504d2ddba55e4bcca2f7a1b6793fa9ba04","time":1763542309000,"email":"volodymyr@foxmail.com","author":"pengzhanbo","message":"feat(theme): add <code>plugin-llms</code> and <code><PageContextMenu /></code> component (#753)"}]},"autoDesc":true,"filePathRelative":"en/config/plugins/llms.md","headers":[],"bulletin":false}`),u={name:`llms.md`},d={class:`vp-file-tree`},f={class:`code-block-title`,"data-title":`.vuepress/config.ts`},p={class:`code-block-title-bar`},m={class:`title`},h={class:`code-block-title`,"data-title":`.vuepress/client.ts`},g={class:`code-block-title-bar`},_={class:`title`};function v(c,l,u,v,y,b){let x=t(`VPCopyButton`),S=t(`VPIcon`),C=t(`FileTreeNode`),w=t(`VPLink`);return n(),i(`div`,null,[l[9]||=o(`<h2 id="overview" tabindex="-1"><a class="header-anchor" href="#overview"><span>Overview</span></a></h2><p>Add <a href="https://llmstxt.org/" target="_blank" rel="noopener noreferrer">llms.txt</a> to your site to provide LLM-friendly content.</p><p><strong>Related Plugin</strong>: <a href="https://ecosystem.vuejs.press/plugins/ai/llms.html" target="_blank" rel="noopener noreferrer">@vuepress/plugin-llms</a></p><h2 id="why-llms-txt" tabindex="-1"><a class="header-anchor" href="#why-llms-txt"><span>Why llms.txt?</span></a></h2><p>Large Language Models increasingly rely on website information but face a key limitation: their context window is too small to fully process most websites. Converting complex HTML pages containing navigation, ads, and JavaScript into LLM-friendly plain text is both difficult and imprecise.</p><p>While websites serve both human readers and LLMs, the latter benefit from more concise, expert-level information collected in one accessible location. This is particularly important for use cases like development environments where LLMs need quick access to programming documentation and APIs.</p><p>Add a <code>/llms.txt</code> Markdown file to your website to provide LLM-friendly content. This file provides brief background information, guidelines, and links to detailed Markdown files.</p><h2 id="features" tabindex="-1"><a class="header-anchor" href="#features"><span>Features</span></a></h2><p>The plugin retrieves all Markdown files from your documentation source directory and converts them into LLM-friendly plain text files.</p>`,9),s(`div`,d,[r(x,{text:`eJzT43o0ZcqjKQ1ApKBXVppaUJRaXKyfkllcwqUABI+mzIFK5uTkFuuVVGAT1k0rzcnBIpebWJSdkl+ep5takZhbkJNarJdRkpsDVQSzFFNRbgoA7os/oQ==`,encode:``,"aria-label":`Copy`,"data-copied":`Copied`}),r(C,{expanded:``,type:`folder`,filename:`.vuepress/dist`,level:0},{icon:e(()=>[r(S,{provider:`iconify`,name:`vscode-icons:folder-type-dist`})]),default:e(()=>[r(C,{type:`file`,filename:`llms.txt`,level:1},{icon:e(()=>[r(S,{provider:`iconify`,name:`vscode-icons:file-type-text`})]),_:1}),r(C,{type:`file`,filename:`llms-full.txt`,level:1},{icon:e(()=>[r(S,{provider:`iconify`,name:`vscode-icons:file-type-text`})]),_:1}),r(C,{type:`file`,filename:`markdown-examples.html`,level:1},{icon:e(()=>[r(S,{provider:`iconify`,name:`vscode-icons:file-type-html`})]),_:1}),r(C,{type:`file`,filename:`markdown-examples.md`,level:1},{icon:e(()=>[r(S,{provider:`iconify`,name:`vscode-icons:file-type-markdown`})]),_:1}),r(C,{type:`file`,filename:`…`,level:1})]),_:1})]),l[10]||=s(`p`,null,`Click the links below to view the llms.txt files for this documentation site:`,-1),s(`ul`,null,[s(`li`,null,[r(w,{href:`/llms.txt`,class:`no-icon`},{default:e(()=>[...l[0]||=[a(`llms.txt`,-1)]]),_:1})]),s(`li`,null,[r(w,{href:`/llms-full.txt`,class:`no-icon`},{default:e(()=>[...l[1]||=[a(`llms-full.txt`,-1)]]),_:1})])]),l[11]||=o(`<div class="hint-container tip"><p class="hint-container-title">Tips</p><p>The plugin only generates <code>llms.txt</code> files and other LLM-friendly documentation files during production builds, i.e., when executing the <code>vuepress build</code> command, and outputs them to the <code>.vuepress/dist</code> directory.</p></div><p><a href="https://ecosystem.vuejs.press/plugins/ai/llms.html#%E6%8F%92%E4%BB%B6%E5%8A%9F%E8%83%BD" class="read-more" target="_blank" rel="noopener noreferrer">View the complete feature description in the <strong>Plugin Official Documentation</strong></a></p><h2 id="configuration" tabindex="-1"><a class="header-anchor" href="#configuration"><span>Configuration</span></a></h2><p>This feature is not enabled by default in the theme. You can enable it through the <code>llmstxt</code> configuration option:</p>`,4),s(`div`,f,[s(`div`,p,[s(`span`,m,[r(S,{provider:`iconify`,name:`vscode-icons:file-type-typescript`}),l[2]||=a(`.vuepress/config.ts`,-1)])]),l[3]||=o(`<div class="language-ts line-numbers-mode" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;">import</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> {</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;"> defineUserConfig</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> }</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">vuepress</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">'</span></span>
|
|
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;">import</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> {</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;"> plumeTheme</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> }</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">vuepress-theme-plume</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">'</span></span>
|
|
<span class="line"></span>
|
|
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;">export</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;"> default</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665;"> defineUserConfig</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">({</span></span>
|
|
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965;"> theme</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">: </span><span style="--shiki-light:#59873A;--shiki-dark:#80A665;">plumeTheme</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">({</span></span>
|
|
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"> // Use the theme's built-in default configuration</span></span>
|
|
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"> // llmstxt: true,</span></span>
|
|
<span class="line"></span>
|
|
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"> // Use custom configuration</span></span>
|
|
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965;"> llmstxt</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">: {</span></span>
|
|
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965;"> locale</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">: </span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">'</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">/</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">'</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">,</span></span>
|
|
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"> // ...other configurations</span></span>
|
|
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;"> },</span></span>
|
|
<span class="line"></span>
|
|
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"> // Can also configure via \`plugins.llmstxt\`, but not recommended</span></span>
|
|
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965;"> plugins</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">: {</span></span>
|
|
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965;"> llmstxt</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">: </span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;">true</span></span>
|
|
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;"> }</span></span>
|
|
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;"> }),</span></span>
|
|
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;">})</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div>`,1)]),l[12]||=s(`p`,null,[s(`a`,{href:`https://ecosystem.vuejs.press/plugins/ai/llms.html#options`,class:`read-more`,target:`_blank`,rel:`noopener noreferrer`},[a(`View the complete configuration options in the `),s(`strong`,null,`Plugin Official Documentation`)])],-1),l[13]||=s(`h2`,{id:`components`,tabindex:`-1`},[s(`a`,{class:`header-anchor`,href:`#components`},[s(`span`,null,`Components`)])],-1),l[14]||=s(`p`,null,[a(`To further enhance interaction between your documentation site and LLMs, you can add the `),s(`code`,null,`<PageContextMenu />`),a(` component to your documentation site.`)],-1),s(`p`,null,[l[5]||=a(`This component is not built-in but is implemented as an additional feature of the theme. Therefore, you need to manually import it and place it in an appropriate location through `,-1),r(w,{href:`../../guide/custom/slots.md`},{default:e(()=>[...l[4]||=[a(`component slots`,-1)]]),_:1}),l[6]||=a(`:`,-1)]),s(`div`,h,[s(`div`,g,[s(`span`,_,[r(S,{provider:`iconify`,name:`vscode-icons:file-type-typescript`}),l[7]||=a(`.vuepress/client.ts`,-1)])]),l[8]||=o(`<div class="language-ts line-numbers-mode" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark has-diff vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;">import</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> {</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;"> defineAsyncComponent</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">,</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;"> h</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> }</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">vue</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">'</span></span>
|
|
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;">import</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> {</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;"> Layout</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> }</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">vuepress-theme-plume/client</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">'</span></span>
|
|
<span class="line diff add"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;">import</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;"> PageContextMenu</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">vuepress-theme-plume/features/PageContextMenu.vue</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">'</span></span>
|
|
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;">import</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> {</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;"> defineClientConfig</span><span style="--shiki-light:#999999;--shiki-dark:#666666;"> }</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">vuepress/client</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">'</span></span>
|
|
<span class="line"></span>
|
|
<span class="line"><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;">export</span><span style="--shiki-light:#1E754F;--shiki-dark:#4D9375;"> default</span><span style="--shiki-light:#59873A;--shiki-dark:#80A665;"> defineClientConfig</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">({</span></span>
|
|
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965;"> layouts</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">: {</span></span>
|
|
<span class="line"><span style="--shiki-light:#998418;--shiki-dark:#B8A965;"> Layout</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">: </span><span style="--shiki-light:#59873A;--shiki-dark:#80A665;">h</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">(</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;">Layout</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">, </span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676;">null</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">, {</span></span>
|
|
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"> // Add PageContextMenu to the doc-title-after slot, i.e., to the right of the article title</span></span>
|
|
<span class="line diff add"><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;"> '</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">doc-title-after</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">'</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">: () => </span><span style="--shiki-light:#59873A;--shiki-dark:#80A665;">h</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">(</span><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;">PageContextMenu</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">), </span></span>
|
|
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;"> }),</span></span>
|
|
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;"> },</span></span>
|
|
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;">})</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div>`,1)]),l[15]||=s(`p`,null,`You can experience this component's functionality to the right of the current page's title.`,-1),l[16]||=s(`div`,{class:`hint-container important`},[s(`p`,{class:`hint-container-title`},`Important`),s(`p`,null,[a(`This component relies entirely on the `),s(`code`,null,`@vuepress/plugin-llms`),a(` plugin and can only be used when you have enabled this plugin's functionality.`)]),s(`p`,null,[a(`Therefore, the functionality provided by this component `),s(`strong`,null,`is only available in the built production package`),a(`.`)])],-1)])}var y=c(u,[[`render`,v]]);export{l as _pageData,y as default}; |