File tree Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ title : 站点地图
3
+ icon : map
4
+ ---
5
+
6
+ PageForge 支持站点地图,可以帮助你快速找到你的网站。默认是禁用的,需要在 ` pageforge.yaml ` 配置文件中启用。
7
+
8
+ ## 启用站点地图
9
+
10
+ ---
11
+
12
+ ``` yaml
13
+ feature :
14
+ sitemap :
15
+ enable : true
16
+ ` ` `
17
+
18
+ > 启用站点地图后,将在底部出现站点地图链接。
19
+
20
+ !!! danger "注意"
21
+
22
+ 启用站点地图,必须要在 ` pageforge.yaml` 文件中添加以下配置
23
+
24
+ ` ` ` yaml
25
+ site:
26
+ baseUrl: https://pageforge.devlive.org
27
+ ` ` `
28
+
29
+ !!!
Original file line number Diff line number Diff line change 128
128
- /setup/i18n
129
129
- /setup/compress
130
130
- /setup/share
131
+ - /setup/sitemap
131
132
- InlineTemplate :
132
133
- /setup/template/home
133
134
- /setup/template/enterprise
Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ class FileProcessor {
316
316
let html = await this . templateEngine . renderWithLayout ( 'layouts/page' , pageData ) ;
317
317
318
318
// 压缩 HTML
319
- if ( this . config . feature ?. compress ?. enable !== false ) {
319
+ if ( this . config . feature ?. compress ?. enable ) {
320
320
try {
321
321
html = minify ( html , this . minifyOptions ) ;
322
322
console . log ( `🗜️ 压缩 ${ relativePath } HTML 完成` ) ;
Original file line number Diff line number Diff line change 10
10
alt= " <%= siteData.site.title %>"
11
11
class = " h-12" >
12
12
< / a>
13
- < a href= " <%= pageData.language ? `/${pageData.language}` : '/' %>" class = " text-xl font-bold text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-200 transition-colors" >
13
+ < a href= " <%= pageData.language ? `/${pageData.language}` : '/' %>"
14
+ class = " text-xl font-bold text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-200 transition-colors" >
14
15
< %= ! siteData .site .hiddenTitle ? siteData .site .title : ' ' % >
15
16
< / a>
16
17
< / div>
53
54
< div class = " flex flex-col items-center sm:flex-row sm:items-center justify-between gap-4" >
54
55
< span class = " text-sm text-gray-500 dark:text-gray-400" >
55
56
< %= locals .siteData ? .footer ? .copyright % > 使用 ❤️ < a href= " https://pageforge.devlive.org" class = " hover:text-blue-600" target= " _blank" > PageForge< / a> 构建
57
+
58
+ < % if (locals .siteData ? .feature ? .sitemap ? .enable ) { % >
59
+ < a href= " /sitemap.xml" target= " _blank" class = " ml-3 dark:hover:text-white hover:underline hover:text-blue-600" > 站点地图< / a>
60
+ < % } % >
56
61
< / span>
57
62
58
63
< % if (locals .siteData ? .footer ? .social ) { % >
You can’t perform that action at this time.
0 commit comments