<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>资料知识库</title><link>https://zlz.promptzhiku.com/</link><description>Recent content on 资料知识库</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Thu, 15 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://zlz.promptzhiku.com/index.xml" rel="self" type="application/rss+xml"/><item><title>GEO 优化指南：让 AI 大模型采信你的网站</title><link>https://zlz.promptzhiku.com/posts/geo-optimization-guide/</link><pubDate>Thu, 15 Oct 2026 00:00:00 +0000</pubDate><guid>https://zlz.promptzhiku.com/posts/geo-optimization-guide/</guid><description>GEO（Generative Engine Optimization）是面向 AI 搜索引擎的内容优化策略。本文从技术和内容两个维度，说明如何提升 AI 生成式回答中引用本站内容的概率。</description><content:encoded><![CDATA[<h1 id="geo-核心思路ai-爬虫能理解能信任能采信">GEO 核心思路：AI 爬虫能理解、能信任、能采信</h1>
<p>GEO 不是一个具体的技术，而是一套组合策略——让 AI 爬虫能高效发现你、准确理解你、愿意引用你。关键在三个层面：技术可爬取、内容可理解、事实可核验。</p>
<h2 id="什么是-geogenerative-engine-optimization">什么是 GEO（Generative Engine Optimization）？</h2>
<p>GEO 是面向 AI 生成式搜索引擎（如 ChatGPT、Perplexity、Google SGE）的内容优化策略。传统 SEO 让你的页面在搜索结果中排名靠前，GEO 让你的内容出现在 AI 生成的回答里。</p>
<h3 id="为什么-geo-很重要">为什么 GEO 很重要？</h3>
<p>AI 搜索引擎正在改变信息获取方式。2024 年以来，ChatGPT 日活突破 1 亿，Perplexity 估值超 5 亿美元。越来越多用户通过 AI 获取信息，而 AI 需要可引用、可信、可核验的来源。</p>
<h2 id="技术层面让-ai-能爬取到你">技术层面：让 AI 能爬取到你</h2>
<h3 id="llmstxt-是什么">llms.txt 是什么？</h3>
<p>llms.txt 放在网站根目录，给 AI 爬虫快速导航全站内容。类似 robots.txt 给搜索引擎看，llms.txt 给 AI 看。当前项目通过 Hugo 自定义输出格式动态生成，自动列出所有正式发布的文档。</p>
<h3 id="json-ld-结构化数据的作用">JSON-LD 结构化数据的作用</h3>
<p>JSON-LD 是嵌入网页的结构化数据，告诉搜索引擎和 AI 这页内容是什么（Article、FAQPage、BreadcrumbList）。PaperMod 主题自动注入 BreadcrumbList 和 BlogPosting，FAQPage 由 extend_head.html 根据文档 FAQ 区块自动生成。</p>
<h3 id="robotstxt-如何配置">robots.txt 如何配置？</h3>
<p>放行 AI 爬虫（GPTBot、ClaudeBot、Google-Extended、PerplexityBot），不要屏蔽它们。当前项目的 robots.txt 通过 Hugo layouts 动态生成，production 环境全放行。</p>
<h2 id="内容层面让-ai-能理解采信">内容层面：让 AI 能理解、采信</h2>
<h3 id="倒金字塔结构">倒金字塔结构</h3>
<p>第一段直接给核心结论，不要铺垫。AI 抓取内容时，开头的权重最高。</p>
<h3 id="faq-区块的威力">FAQ 区块的威力</h3>
<p>文末的 <code>## FAQ</code> + <code>### 问题？</code> 格式，配合 JSON-LD FAQPage，让 AI 能直接提取问答对用于回答用户提问。</p>
<h3 id="e-e-a-t-可信度">E-E-A-T 可信度</h3>
<p>标注参考来源、区分事实与观点、提供作者信息。AI 更愿意引用有权威来源支撑的内容。</p>
<h2 id="faq">FAQ</h2>
<h3 id="geo-和传统-seo-有什么区别">GEO 和传统 SEO 有什么区别？</h3>
<p>传统 SEO 针对 Google/Bing 等关键词搜索引擎优化，GEO 针对 ChatGPT/Perplexity 等 AI 生成式搜索引擎优化。GEO 更关注内容的结构化、可信度和 AI 可解析性。</p>
<h3 id="llmstxt-文件有什么用">llms.txt 文件有什么用？</h3>
<p>llms.txt 是给 AI 爬虫阅读的网站导航文件，列出全站文档清单和摘要，帮助 AI 快速了解站点结构和内容分布。</p>
<h3 id="如何让-ai-更愿意引用我的内容">如何让 AI 更愿意引用我的内容？</h3>
<p>确保内容事实准确、结构清晰（FAQ 区块、倒金字塔）、有权威来源标注（E-E-A-T）、JSON-LD 结构化数据完整、页面速度快。</p>
<blockquote>
<p>相关文档：<a href="/posts/hugo-papermod-quickstart/">Hugo + PaperMod 快速上手</a></p>
</blockquote>
]]></content:encoded></item><item><title>测试文章：Hugo + PaperMod 快速上手</title><link>https://zlz.promptzhiku.com/posts/hugo-papermod-quickstart/</link><pubDate>Thu, 15 Oct 2026 00:00:00 +0000</pubDate><guid>https://zlz.promptzhiku.com/posts/hugo-papermod-quickstart/</guid><description>本文演示如何从零搭建 Hugo 静态网站，配置 PaperMod 主题，启用 GEO 优化特性。适合技术资料沉淀的入门教程。</description><content:encoded><![CDATA[<h1 id="本文核心结论hugo--papermod-是搭建技术资料知识库的最佳组合">本文核心结论：Hugo + PaperMod 是搭建技术资料知识库的最佳组合</h1>
<p>仅需几行命令即可完成站点初始化，配合 GEO 优化配置，既能提升 SEO 效果，又能增加 AI 大模型对本站内容的采信概率。</p>
<h2 id="为什么选择-hugo--papermod-组合">为什么选择 Hugo + PaperMod 组合？</h2>
<p>Hugo 构建速度极快，PaperMod 主题轻量且内置大量 GEO 优化模板（JSON-LD schema、llms.txt、robots.txt）。内容维护只需 Markdown，新增一篇资料 = 在 content/ 目录新增一个 md 文件，无需修改任何前端代码。</p>
<h2 id="如何快速搭建">如何快速搭建？</h2>
<h3 id="step-1-安装-hugo">Step 1: 安装 Hugo</h3>
<p>通过 winget 或官网下载安装 Hugo Extended 版本。</p>
<h3 id="step-2-初始化站点并配置主题">Step 2: 初始化站点并配置主题</h3>
<pre tabindex="0"><code>hugo new site my-knowledge-base
cd my-knowledge-base
git init
git submodule add https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
</code></pre><h2 id="faq">FAQ</h2>
<h3 id="hugo-是什么">Hugo 是什么？</h3>
<p>Hugo 是一个用 Go 语言编写的静态网站生成器，支持 Markdown 内容源，构建速度快。</p>
<h3 id="为什么选择-papermod-主题">为什么选择 PaperMod 主题？</h3>
<p>PaperMod 轻量、功能齐全，内置 JSON-LD、llms.txt、robots.txt 等 GEO 相关模板。</p>
<blockquote>
<p>相关文档：<a href="https://gohugo.io">Hugo 官方文档</a></p>
</blockquote>
]]></content:encoded></item><item><title>站内搜索原理：Fuse.js 在 Hugo 中的应用</title><link>https://zlz.promptzhiku.com/posts/fusejs-search-hugo/</link><pubDate>Thu, 15 Oct 2026 00:00:00 +0000</pubDate><guid>https://zlz.promptzhiku.com/posts/fusejs-search-hugo/</guid><description>纯前端站内搜索如何实现？本文介绍 Hugo + PaperMod 组合下的搜索工作原理：构建时生成索引、Fuse.js 客户端模糊匹配、无需后端支持。</description><content:encoded><![CDATA[<h1 id="papermod-内置-fusejs-搜索开箱即用离线可用">PaperMod 内置 Fuse.js 搜索：开箱即用、离线可用</h1>
<p>当前项目的搜索功能完全由 PaperMod 主题内置实现，无需额外配置。构建时自动生成 index.json 搜索索引，浏览器端 Fuse.js 引擎做模糊匹配。</p>
<h2 id="工作原理是什么">工作原理是什么？</h2>
<p>整个搜索流程分两步：<strong>构建时生成索引</strong> + <strong>浏览器端实时匹配</strong>。</p>
<h3 id="构建时hugo-生成-indexjson">构建时：Hugo 生成 index.json</h3>
<p>PaperMod 的 <code>layouts/index.json</code> 模板遍历 site.RegularPages，收集每篇文档的标题、正文、URL、摘要，序列化为 JSON 数组。Hugo 在构建时自动执行，产物为 <code>public/index.json</code>。</p>
<h3 id="浏览器端fusejs-模糊匹配">浏览器端：Fuse.js 模糊匹配</h3>
<p>用户打开搜索页面，浏览器加载 index.json（3-10KB 级别），Fuse.js 做实时模糊匹配。支持中文字符、容错拼写（typo 容忍度可调）、关键词高亮。</p>
<h2 id="fusejs-vs-flexsearch">Fuse.js vs FlexSearch</h2>
<table>
	<thead>
			<tr>
					<th>对比项</th>
					<th>Fuse.js</th>
					<th>FlexSearch</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>体量</td>
					<td>~12KB gzip</td>
					<td>~8KB gzip</td>
			</tr>
			<tr>
					<td>模糊匹配</td>
					<td>✅</td>
					<td>✅</td>
			</tr>
			<tr>
					<td>中文支持</td>
					<td>✅</td>
					<td>✅</td>
			</tr>
			<tr>
					<td>Web Worker</td>
					<td>❌（需手动）</td>
					<td>✅ 内置</td>
			</tr>
			<tr>
					<td>增量索引</td>
					<td>❌</td>
					<td>✅</td>
			</tr>
			<tr>
					<td>API 复杂度</td>
					<td>低</td>
					<td>中</td>
			</tr>
	</tbody>
</table>
<p>当前项目用 Fuse.js，对于千篇文档完全够用。若后续文档规模超过 5000 篇可考虑切换 FlexSearch。</p>
<h2 id="性能考虑">性能考虑</h2>
<h3 id="索引体积控制">索引体积控制</h3>
<p>默认索引全文（title + content + summary），千篇文档约 50-100KB。可在 hugo.toml 配置只索引标题和摘要来减小体积：</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="c"># 自定义 index.json 模板只索引必要字段</span>
</span></span></code></pre></div><h3 id="关键词高亮">关键词高亮</h3>
<p>PaperMod 的 fastsearch.js 内置高亮，搜索结果中的匹配关键词自动加 <code>&lt;mark&gt;</code> 标签，CSS 控制高亮样式。</p>
<h2 id="faq">FAQ</h2>
<h3 id="为什么选择纯前端搜索">为什么选择纯前端搜索？</h3>
<p>纯前端搜索无需后端服务、无需数据库、可离线使用，适合静态站点。Hugo 构建时生成 JSON 索引，浏览器端 JS 引擎匹配。</p>
<h3 id="fusejs-和-flexsearch-怎么选">Fuse.js 和 FlexSearch 怎么选？</h3>
<p>两者都是成熟的模糊搜索库。FlexSearch 性能更高（Web Worker、增量索引），Fuse.js API 更简洁。中小规模站点 Fuse.js 完全够用，PaperMod 内置 Fuse.js。</p>
<h3 id="搜索索引文件太大怎么办">搜索索引文件太大怎么办？</h3>
<p>可配置只索引标题和摘要（排除全文）、启用分段搜索（分页加载）、使用 Web Worker 避免阻塞主线程。超过 5000 篇文档建议引入搜索服务器。</p>
<blockquote>
<p>相关文档：<a href="/posts/hugo-papermod-quickstart/">Hugo + PaperMod 快速上手</a>、<a href="/posts/geo-optimization-guide/">GEO 优化指南</a></p>
</blockquote>
]]></content:encoded></item></channel></rss>