Last Updated
lastUpdatedPlugin()
allows you to specify a custom datetime format for the "last updated" date, for the default theme. It uses Luxon to perform the formatting.
How to use
In your Config File, add the lastUpdatedPlugin()
:
import {defineUserConfig} from 'vuepress';
import {lastUpdatedPlugin} from "@aedart/vuepress-utils/plugins";
export default defineUserConfig({
// ...other settings not shown...
plugins: [
lastUpdatedPlugin()
]
});
Format
Use the format
argument to specify your desired datetime format. See Luxon documentation for available format tokens.
lastUpdatedPlugin({ format: 'dd-MM-yyyy HH:mm:ss' })
Note
The plugin uses yyyy-MM-dd HH:mm:ss ZZZZ
as default format, when none is given.
Example output: 2023-03-19 16:09:20 GMT+1