sitemap.xmlの作成

単純にURLと更新日のみのサイトマップ (XML形式のSitemaps XML) を作成するには、以下のようなビューをインデックス・テンプレート(アーカイブ種別: インデックス)として作成し、URLマップを「sitemap.xml」などとします。

重複URLへの考慮や含めたいモデルの選択、URLが5万件を超えた時に分割するなど、必要に応じて調整してください。

<mt:block regex_replace="'/^%s+$/um',''" remove_blank="1">
<mt:objectloop model="urlinfo" delete_flag="0" mime_type="text/html" cols="url,filemtime" workspace_ids="this">
<mt:if name="__first__">
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</mt:if>
  <url>
    <loc><mt:var name="url"></loc>
    <lastmod><mt:date unixtime="$filemtime" format="Y-m-d"></lastmod>
  </url>
<mt:if name="__last__">
</urlset>
</mt:if>
</mt:objectloop>
</mt:block>