mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 12:52:31 +02:00
feat(pages): add LastUpdateAuthor & LastUpdateTime & editUrl (#10032)
Co-authored-by: OzakIOne <OzakIOne@users.noreply.github.com> Co-authored-by: sebastien <lorber.sebastien@gmail.com>
This commit is contained in:
parent
e4ecffe418
commit
d1590e37ac
12 changed files with 254 additions and 8 deletions
|
@ -11,6 +11,7 @@ import {
|
|||
RehypePluginsSchema,
|
||||
AdmonitionsSchema,
|
||||
RouteBasePathSchema,
|
||||
URISchema,
|
||||
} from '@docusaurus/utils-validation';
|
||||
import {GlobExcludeDefault} from '@docusaurus/utils';
|
||||
import type {OptionValidationContext} from '@docusaurus/types';
|
||||
|
@ -27,6 +28,9 @@ export const DEFAULT_OPTIONS: PluginOptions = {
|
|||
beforeDefaultRehypePlugins: [],
|
||||
beforeDefaultRemarkPlugins: [],
|
||||
admonitions: true,
|
||||
showLastUpdateTime: false,
|
||||
showLastUpdateAuthor: false,
|
||||
editLocalizedFiles: false,
|
||||
};
|
||||
|
||||
const PluginOptionSchema = Joi.object<PluginOptions>({
|
||||
|
@ -44,6 +48,12 @@ const PluginOptionSchema = Joi.object<PluginOptions>({
|
|||
DEFAULT_OPTIONS.beforeDefaultRemarkPlugins,
|
||||
),
|
||||
admonitions: AdmonitionsSchema.default(DEFAULT_OPTIONS.admonitions),
|
||||
showLastUpdateTime: Joi.bool().default(DEFAULT_OPTIONS.showLastUpdateTime),
|
||||
showLastUpdateAuthor: Joi.bool().default(
|
||||
DEFAULT_OPTIONS.showLastUpdateAuthor,
|
||||
),
|
||||
editUrl: Joi.alternatives().try(URISchema, Joi.function()),
|
||||
editLocalizedFiles: Joi.boolean().default(DEFAULT_OPTIONS.editLocalizedFiles),
|
||||
});
|
||||
|
||||
export function validateOptions({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue