diff --git a/docs/content/getting-started/publish-site.md b/docs/content/getting-started/publish-site.md index 471fe07..b05ea5e 100644 --- a/docs/content/getting-started/publish-site.md +++ b/docs/content/getting-started/publish-site.md @@ -69,4 +69,10 @@ deploy: buildDir: dist username: devlive-community email: support@devlive.org +``` + +使用以下命令发布到 Github Pages: + +```bash +pageforge deploy-github ``` \ No newline at end of file diff --git a/lib/indexer-generator.js b/lib/indexer-generator.js index e363df6..107a458 100644 --- a/lib/indexer-generator.js +++ b/lib/indexer-generator.js @@ -1,6 +1,6 @@ const fs = require('fs'); const path = require('path'); -const { isFeatureEnabled } = require('./utils'); +const {isFeatureEnabled} = require('./utils'); class SearchIndexBuilder { constructor(config, pages, getNavigation) { @@ -18,7 +18,9 @@ class SearchIndexBuilder { // 处理导航项 processNavItem(item, lang) { - if (!item) return; + if (!item) { + return; + } if (item.href) { // 将 /.html 转换为 /index.html @@ -32,7 +34,7 @@ class SearchIndexBuilder { const filePath = this.getFilePath(normalizedHref); if (filePath && fs.existsSync(filePath)) { const content = fs.readFileSync(filePath, 'utf-8'); - const { title, processedContent } = this.parseContent(content, filePath); + const {title, processedContent} = this.parseContent(content, filePath); // 构建搜索项 const searchItem = { @@ -101,7 +103,7 @@ class SearchIndexBuilder { // 清理 Markdown 语法 processedContent = this.cleanMarkdown(processedContent); - return { title, processedContent }; + return {title, processedContent}; } // 清理 Markdown 语法 diff --git a/templates/assets/js/pageforge-search.js b/templates/assets/js/pageforge-search.js index 2b7033c..52c60b2 100644 --- a/templates/assets/js/pageforge-search.js +++ b/templates/assets/js/pageforge-search.js @@ -204,22 +204,23 @@ const Search = { this.els.searchResults.innerHTML = `