UNPKG

sbg-api

Version:

Pre-processing all source posts before rendering from hexo. Useful for low-end devices to prevent using large number of hexo plugins.

40 lines (37 loc) 1.07 kB
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> {% for post in posts %} <url> <loc>{{ post.permalink | uriencode }}</loc> {% if post.updated %} <lastmod>{{ post.updated | formatDate }}</lastmod> {% elif post.date %} <lastmod>{{ post.date | formatDate }}</lastmod> {% endif %} <changefreq>monthly</changefreq> <priority>0.8</priority> </url> {% endfor %} <url> <loc>{{ config.url | uriencode }}</loc> <lastmod>{{ sNow | formatDate }}</lastmod> <changefreq>daily</changefreq> <priority>1.0</priority> </url> {% for tag in tags %} <url> <loc>{{ tag.permalink | uriencode }}</loc> <lastmod>{{ sNow | formatDate }}</lastmod> <changefreq>weekly</changefreq> <priority>0.2</priority> </url> {% endfor %} {% for cat in categories %} <url> <loc>{{ cat.permalink | uriencode }}</loc> <lastmod>{{ sNow | formatDate }}</lastmod> <changefreq>weekly</changefreq> <priority>0.2</priority> </url> {% endfor %} </urlset>