How to Keep CreatedAt and UpdatedAt after Deploy in NuxtJS

Author: zemna
Date: April 24, 2021
Share this:

If you using git, createdAt and updatedAt data for your content using @nuxt/content module will be always reset to deployment date in your live server.

This is because git does not file metadata.

We can use git history based on your commit date.

Install nuxt-content-git package from npm

nuxt-content-git is additional module for @nuxt/content that replaces or adds createdAt and updatedAt dates based on the git history.

npm install nuxt-content-git --save

Configure nuxt-content-git in nuxt.config.js

Add nuxt-content-git to modules before @nuxt/content in your nuxt.config.js file.

export default {
  // ...
  modules: [
  // ...


Lets deploy and check createdAt and updatedAt date for your content.

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *

Let's connect and create
something awesome together!
2023 - Copyright, All Rights Reserved, Made by ZEMNA.NET with ❤️
crossmenu linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram