fix: #9301, dont call sitemapstream if there are no entries in categories/pages/topics.xml

This commit is contained in:
Barış Soner Uşaklı
2021-02-12 23:18:16 -05:00
parent 50664487b9
commit 9a6cf3d967
2 changed files with 66 additions and 29 deletions

View File

@@ -1,12 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{{ if pages }}}
<sitemap>
<loc>{url}/sitemap/pages.xml</loc>
</sitemap>
{{{ end }}}
{{{ if categories }}}
<sitemap>
<loc>{url}/sitemap/categories.xml</loc>
</sitemap>
{{{ each topics }}}
{{{ end }}}
{{{ each topics }}}
<sitemap>
<loc>{url}/sitemap/topics.{@value}.xml</loc>
</sitemap>