Commit c5bbfe4a authored by Mike Street's avatar Mike Street
Browse files

Bug: Remove optional chaining

parent 8deec7f9
......@@ -5,10 +5,10 @@ sitemapIgnore: true
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{%- for item in collections.all %}
{%- if (item.data.sitemapIgnore !== true) and (item.data.draft !== true) %}
{%- if (item.data) and (item.data.sitemapIgnore !== true) and (item.data.draft !== true) %}
<url>
<loc>{{ meta.site.url }}{{ item.url }}</loc>
<lastmod>{{ item?.data?.updated or item.date | dateISOShort }}</lastmod>
<lastmod>{{ item.data.updated or item.date | dateISOShort }}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
......
......@@ -4,10 +4,13 @@
post: function() {
let pending = this.ctx.collections['scheduled'];
return {
title: pending[0]?.data?.title,
date: pending[0]?.date
};
if(pending.length) {
return {
title: pending[0].data.title,
date: pending[0].date
};
}
}
}
---
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment