<loc>https://idatu.com/chunlan-dafugui.html</loc>
<lastmod>2018-11-17</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
其中的<loc>告诉搜索引擎网页的地址;<lastmod>告知该文章最后的修改时间;<changefreq>告诉搜索蜘蛛文章的跟新频率;<priority>的意思是这个网页在该网站上的重要程度。实际上,上面最重要的参数就是<loc>。就我许久的观察,其它的参数就算你提交了,搜索引擎蜘蛛也不会理你。
在百度移动Sitemap协议中,百度在标准Sitemap协议基础上增加了mobile标签,它有四种取值:
<mobile:mobile/> :移动网页
<mobile:mobile type="mobile"/> :移动网页
<mobile:mobile type="pc,mobile"/>:响应式网页
<mobile:mobile type="htmladapt"/>:代码适配
我的Joomla站点采用响应式布局,就是上面的 type="pc,mobile"。下面来说JSitemap的修改。
安装好JSitemap之后,在/components/com_jmap/views/sitemap/tmpl这个目录下找到default_xml.php这个文件,删除第17行,修改为:
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:mobile="https://www.baidu.com/schemas/sitemap-mobile/1/">
同目录下找到default_xml_content.php,在第54行的</loc>下面多加一行,内容如下:
<mobile:mobile type="pc,mobile"/>
也是在同目录下的default_xml_menu.php,在第90行的</loc>下面多加一行,内容和上面的一样。(修改结束)
然后,就让JSitemap生成网站地图,愉快的去百度搜索资源平台上提交。附上:一像素的sitemap