🐛 Fixed sitemap generation with correct date and images value (#10668)

closes #10640

- Updated sitemap resources data to include certain fields
- Fixes sitemap date and images value
- Updated date handling for sitemap nodes
This commit is contained in:
Rishabh Garg 2019-04-09 12:43:07 +05:30 committed by GitHub
parent 87b37556c8
commit 35c4da710a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -65,7 +65,13 @@ class BaseSiteMapGenerator {
}
getLastModifiedForDatum(datum) {
return datum.updated_at || datum.published_at || datum.created_at;
if (datum.updated_at || datum.published_at || datum.created_at) {
const modifiedDate = datum.updated_at || datum.published_at || datum.created_at;
return moment(modifiedDate);
} else {
return moment();
}
}
updateLastModified(datum) {

View File

@ -27,7 +27,6 @@ module.exports = [
'twitter_title',
'twitter_description',
'custom_template',
'feature_image',
'locale'
],
withRelated: ['tags', 'authors'],
@ -68,7 +67,6 @@ module.exports = [
'twitter_title',
'twitter_description',
'custom_template',
'feature_image',
'locale',
'tags',
'authors',

View File

@ -30,7 +30,6 @@ module.exports = [
'twitter_title',
'twitter_description',
'custom_template',
'feature_image',
'locale'
],
withRelated: ['tags', 'authors'],
@ -74,7 +73,6 @@ module.exports = [
'twitter_title',
'twitter_description',
'custom_template',
'feature_image',
'locale',
'tags',
'authors',
@ -98,9 +96,7 @@ module.exports = [
'description',
'meta_title',
'meta_description',
'parent_id',
'created_at',
'updated_at'
'parent_id'
],
filter: 'visibility:public',
shouldHavePosts: {