You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue here is that, the default docusaurus plugin (i.e.,plugin-content-docs) that captures the 'date' and 'author' information for doc file uses git log command to retrieve these information when the options: showLastUpdateAuthor and showLastUpdateTime are set to true.
function getFileCommitDate(file, { age = 'oldest', includeAuthor = false, }) {
if (!shelljs_1.default.which('git')) {
throw new GitNotFoundError(`Failed to retrieve git history for "${file}" because git is not installed.`);
}
if (!shelljs_1.default.test('-f', file)) {
throw new Error(`Failed to retrieve git history for "${file}" because the file does not exist.`);
}
const args = [
`--format=%ct${includeAuthor ? ',%an' : ''}`,
'--max-count=1',
age === 'oldest' ? '--follow --diff-filter=A' : undefined,
]
.filter(Boolean)
.join(' ');
const result = shelljs_1.default.exec(`git log ${args} -- "${path_1.default.basename(file)}"`, {
As the spec website is a submodule of the spec documentation and the source files are copied to the docusaurus's to 'src/docs' directory at building time, the default plugin cannot get the required information from the local website git repo (because the directory is ignored by the local .gitignore).
A potential solution I see here is to re-write a new plugin for docusaurus to grab the information from the spec-repo by using git API instead of git log.
It would be nice to have the date when was the given page last updated. The field exists, it just has to be populated.
The text was updated successfully, but these errors were encountered: