-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add <lastmod> to sitemap #9234
Changes from all commits
088e807
9a425bc
791da2e
3a2b5bf
63f8f3c
334c4b3
3e0b37b
ddba059
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
*/ | ||
|
||
import path from 'path'; | ||
import _ from 'lodash'; | ||
import logger from '@docusaurus/logger'; | ||
import { | ||
normalizeUrl, | ||
|
@@ -233,6 +234,8 @@ | |
modules: { | ||
archive: aliasedSource(archiveProp), | ||
}, | ||
lastModified: _.maxBy(blogPosts, (item) => item.metadata.date) | ||
?.metadata?.date, | ||
Comment on lines
+237
to
+238
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed? |
||
}); | ||
} | ||
|
||
|
@@ -274,6 +277,7 @@ | |
sidebar: aliasedSource(sidebarProp), | ||
content: metadata.source, | ||
}, | ||
lastModified: metadata.date, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have |
||
}); | ||
|
||
blogItemsToMetadata[id] = metadata; | ||
|
@@ -299,6 +303,7 @@ | |
items: blogPostItemsModule(items), | ||
metadata: aliasedSource(pageMetadataPath), | ||
}, | ||
lastModified: metadata.latestModified, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed |
||
}); | ||
}), | ||
); | ||
|
@@ -321,6 +326,10 @@ | |
sidebar: aliasedSource(sidebarProp), | ||
tags: aliasedSource(tagsPropPath), | ||
}, | ||
lastModified: _.maxBy( | ||
_.flatMap(blogTags, (item) => item.pages), | ||
(item) => item.metadata?.latestModified, | ||
)?.metadata?.latestModified, | ||
}); | ||
} | ||
|
||
|
@@ -348,6 +357,7 @@ | |
tag: aliasedSource(tagPropPath), | ||
listMetadata: aliasedSource(listMetadataPath), | ||
}, | ||
lastModified: metadata.latestModified, | ||
}); | ||
}), | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -499,6 +499,8 @@ yarn workspace v1.22.19image` is a collocated image path, this entry will be the | |
readonly totalCount: number; | ||
/** Total number of list pages. */ | ||
readonly totalPages: number; | ||
/** Latest modified date of posts on the current page. */ | ||
readonly latestModified?: Date; | ||
Comment on lines
+502
to
+503
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed |
||
}; | ||
|
||
export type BlogPaginated = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed