Skip to content

Add "Last Updated Timestamp"

Edit config.mjs

We will be adding code inside this:

/.vitepress/config.mjs
mjs
import { defineConfig } from "vitepress";

export default defineConfig({
    // ==> Inside Here <==
});

Just add a lastUpdated prop inside the defaultConfig.

/.vitepress/config.mjs
mjs
import { defineConfig } from "vitepress";

export default defineConfig({
    lastUpdated: true
});

Edit package.json

package.json
json
{
  "name": "naughty_docs",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "vitepress dev --host",
    "build": "vitepress build",
    "build": "git fetch --unshallow && vitepress build",
    "preview": "vitepress preview --host"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "type": "module",
  "devDependencies": {
    "vitepress": "^2.0.0-alpha.15"
  }
}

Thats all. Set Up and forget about it.

Reference

Official Docs 🚀

You are your Biggest Ally and Enemy