Skip to main content

detect_sitemap_type

Function detect_sitemap_type 

Source
pub fn detect_sitemap_type(url: &str) -> SitemapType
Expand description

根据 Sitemap 的 URL 路径和扩展名推测 Sitemap 类型。

规则:

  • .txt → Text
  • .gz.gzip → Gzip
  • 路径含 news → News
  • 路径含 image → Image
  • 路径含 video → Video
  • 路径含 indexsitemapindex → Index
  • 默认 → Xml