Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeFreq ¶
type ChangeFreq string
const ( ALWAYS ChangeFreq = "always" HOURLY ChangeFreq = "hourly" DAILY ChangeFreq = "daily" WEEKLY ChangeFreq = "weekly" MONTHLY ChangeFreq = "monthly" YEARLY ChangeFreq = "yearly" )
"always", "hourly", "daily", "weekly", "monthly", "yearly"
type Sitemap ¶
func NewSitemap ¶
func (*Sitemap) CreateSitemapContent ¶
func (this *Sitemap) CreateSitemapContent(su []SitemapUrl, file string) error
生成站点地图内容 <?xml version="1.0" encoding="utf-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <url> <loc>http://www.baidu.com</loc> <priority>0.5</priority> <lastmod>2017-12-27</lastmod> <changefreq>weekly</changefreq> </url> </urlset>
func (*Sitemap) CreateSitemapIndex ¶
func (this *Sitemap) CreateSitemapIndex(si []SitemapIndex, file string) error
生成站点地图索引
<?xml version="1.0" encoding="UTF-8"?> <sitemapindex> <sitemap> <loc>http://www.wangpanzhijia.net/static/Sitemap/share-0-5000.xml</loc> <lastmod>2016-12-26</lastmod> </sitemap> </sitemapindex>
type SitemapIndex ¶
sitemap索引
type SitemapUrl ¶
type SitemapUrl struct { Loc string //链接,必填,长度不能超过256个字符 Lastmod string //链接内容最后更新时间,选填 ChangeFreq ChangeFreq //链接更新频率,选填 Priority float32 //权重,0.0-1.0之间 }
sitemap链接结构
Click to show internal directories.
Click to hide internal directories.