mirror of https://github.com/halo-dev/halo
Support disable spider.
parent
363acf467b
commit
9342fa7294
|
@ -12,7 +12,12 @@ public enum OtherProperties implements PropertyEnum {
|
|||
|
||||
API_TOKEN("api_token", String.class, ""),
|
||||
|
||||
STATISTICS_CODE("statistics_code", String.class, "");
|
||||
STATISTICS_CODE("statistics_code", String.class, ""),
|
||||
|
||||
/**
|
||||
* 是否禁止爬虫
|
||||
*/
|
||||
SPIDER_DISABLE("spider_disable",Boolean.class,"false");
|
||||
|
||||
private final String value;
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<#if options.spider_disable!false>
|
||||
User-agent: /
|
||||
Disallow: /
|
||||
<#else>
|
||||
User-agent: *
|
||||
Disallow: /admin/
|
||||
Sitemap: ${options.blog_url!}/sitemap.xml
|
||||
Sitemap: ${options.blog_url!}/sitemap.html
|
||||
</#if>
|
Loading…
Reference in New Issue