織夢dedecms在默認程序中就自帶了百度地圖,所以在生成的時候就容易多了,但是在谷歌地圖上就沒有那么簡單了,網站地圖對優化也有很大的好處,所以在網站中最好兩個地圖都存在,這樣才能讓網站有一個更好的排名。
復制下面的這些代碼保存為sitemap.htm模板文件然后上傳到模板所在目錄templets/{style}/sitemap.htm 這樣的路徑,其中{style}為模板文件夾
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.織夢58dede58.com/schemas/sitemap/0.9">
<url>
<loc>http://你的域名</loc>
<lastmod>{dede:arclist row=1 titlelen=24 orderby=pubdate}
[field:pubdate function=strftime('%Y-%m-%d',@me)/]
{/dede:arclist}</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
{dede:channel row='100' type='top'}
<url>
<loc>http://你的域名[field:typelink /]</loc>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
{/dede:channel}
{dede:arclist row=10000 orderby=pubdate}
<url>
<loc>http://你的域名[field:arcurl/]</loc>
<lastmod>[field:pubdate function=strftime('%Y-%m-%d',@me)/]</lastmod>
<changefreq>monthly</changefreq>
</url>
{/dede:arclist}
</urlset>