ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# SEO设置-静态生成 ## SEO设置-静态生成 用于生成静态页面,支持首页、栏目页、内容页生成。 ## 开启 配置中心-》SEO设置-》URL配置,选择静态生成 ![](https://img.kancloud.cn/5a/50/5a50e4e06b0ed680912fee75dbe7dd29_816x910.jpg) ## 使用说明 - 栏目规则说明 1. 父目录/子目录 **父目录**:如果生成的当前栏目有父级则取父级的目录名称 **子目录**:取当前生成栏目的目录名称 例如:栏目名称:公司新闻,目录名称:company\_news,父级栏目:新闻中心,父级栏目名称:news 生成新闻中心:/news/index.html 多语言效果:/zh-cn/news/index.html,/en/news/index.html,这里的zh-cn与en取决多语言里面的设置 生成公司新闻:/news/company\_news/index.html 多语言效果:/zh-cn/news/company\_news/index.html 2. 目录名称 同上一样,只是不含父级栏目 生成新闻中心:/news/index.html 生成公司新闻:/company\_news/index.html - 内容规则 基本与栏目规则一致,假设文档ID为1,所属栏目为公司新闻 生成文档静态:/company\_news/1.html - 保存目录 默认生成的静态文件是放在public目录下,若想在public目录下新建html文件夹然后生成的栏目页、内容页放置于此,那么在保存目录里面填写html即可。 ## 自定义栏目规则与内容规则 目前支持的规则变量有: ``` <pre class="calibre16">``` <span class="token1">[</span>catdir<span class="token1">]</span>:父栏目栏目名称 <span class="token1">[</span>list<span class="token1">]</span><span class="token1">:</span> 栏目名称 <span class="token1">[</span>id<span class="token1">]</span><span class="token1">:</span> 文档ID <span class="token1">[</span>year<span class="token1">]</span><span class="token1">:</span> 文档发布的年分 <span class="token1">[</span>month<span class="token1">]</span><span class="token1">:</span> 文档发布的月 <span class="token1">[</span>day<span class="token1">]</span><span class="token1">:</span> 文档发布的日 <span class="token1">[</span>page<span class="token1">]</span>:分页 ``` ``` 例如栏目规则(父目录/子目录)完整规则如下: ``` <pre class="calibre16">``` <span class="token">/</span><span class="token1">[</span>catdir<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span>index<span class="token1">.</span>html<span class="token">|</span><span class="token">/</span><span class="token1">[</span>catdir<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span>index_<span class="token1">[</span>page<span class="token1">]</span><span class="token1">.</span>html ``` ``` 我们可以看到中间有“|”符合隔开,意思是“|”左边的是首页规则右边的则是分页规则。效果如下: 第一页(首页):采用左边的首页规则 `/news/company_news/index.html` 第二页: 开始采用右边的规则 `/news/company_news/index_2.html` 第三页 `/news/company_news/index_3.html` 所以在自定义规则时需要写好左边与右边的规则,注意注意注意使用“|”分隔 内置的规则参考: ``` <pre class="calibre20">``` <span class="token">/</span>父级栏目<span class="token">/</span>子栏目<span class="token">/</span>index<span class="token1">.</span>html<span class="token">|</span>父级栏目<span class="token">/</span>子栏目<span class="token">/</span>index_2<span class="token1">.</span>html <span class="token">/</span><span class="token1">[</span>catdir<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span>index<span class="token1">.</span>html<span class="token">|</span><span class="token">/</span><span class="token1">[</span>catdir<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span>index_<span class="token1">[</span>page<span class="token1">]</span><span class="token1">.</span>html <span class="token">/</span>栏目名称<span class="token">/</span>index<span class="token1">.</span>html<span class="token">|</span><span class="token">/</span>栏目名称<span class="token">/</span>index_2<span class="token1">.</span>html <span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span>index<span class="token1">.</span>html<span class="token">|</span><span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span>index_<span class="token1">[</span>page<span class="token1">]</span><span class="token1">.</span>html <span class="token">/</span>父级栏目<span class="token">/</span>子栏目<span class="token">/</span>文档ID<span class="token1">.</span>html<span class="token">|</span>父级栏目<span class="token">/</span>子栏目<span class="token">/</span>文档ID_1<span class="token1">.</span>html <span class="token">/</span><span class="token1">[</span>catdir<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>id<span class="token1">]</span><span class="token1">.</span>html<span class="token">|</span><span class="token">/</span><span class="token1">[</span>catdir<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>id<span class="token1">]</span>_<span class="token1">[</span>page<span class="token1">]</span><span class="token1">.</span>html <span class="token">/</span>栏目名称<span class="token">/</span>文档ID<span class="token1">.</span>html<span class="token">|</span>栏目名称<span class="token">/</span>文档ID_2<span class="token1">.</span>html <span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>id<span class="token1">]</span><span class="token1">.</span>html<span class="token">|</span><span class="token">/</span><span class="token1">[</span>list<span class="token1">]</span><span class="token">/</span><span class="token1">[</span>id<span class="token1">]</span>_<span class="token1">[</span>page<span class="token1">]</span><span class="token1">.</span>html ``` ```