1.0.7 • Published 3 years ago

nuxt-content-hooks-git v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

nuxt-content-hooks-git

nuxt-content hooks that replace or add createdAt and updatedAt dates based on the git history.

ℹ️ There is also a Nuxt.js module that does the same thing and is probably cleaner to use.

Install

# npm
$ npm install nuxt-content-hooks-git

# Yarn
$ yarn add nuxt-content-hooks-git

Usage

Add the hooks to your hooks config:

import nuxtContentHooksGit from 'nuxt-content-hooks-git'

export default {
  hooks: {
    ...
    ...nuxtContentHooksGit(),
  },
}

This will replace doc.createdAt and doc.updatedAt with the dates from the Git log.

It is also possible to not override the values but instead specify the field names like this:

import nuxtContentHooksGit from 'nuxt-content-hooks-git'

export default {
  hooks: {
    ...
    ...nuxtContentHooksGit({ createdAtName: 'gitCreatedAt', updatedAtName: 'gitUpdatedAt' }),
  },
}

Then you can access them via doc.gitCreatedAt and doc.gitUpdatedAt.

Contribute

Are you missing something or want to contribute? Feel free to file an issue or a pull request! ⚙️

Support

Hey, I am Sebastian Landwehr, a freelance web developer, and I love developing web apps and open source packages. If you want to support me so that I can keep packages up to date and build more helpful tools, you can donate here:

Thanks a lot for your support! ❤️

License

MIT License © Sebastian Landwehr

1.0.7

3 years ago

1.0.6

3 years ago

1.0.2

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago