{"id":16260575,"url":"https://github.com/dword-design/nuxt-content-git","last_synced_at":"2025-03-15T11:31:49.491Z","repository":{"id":37036954,"uuid":"350294074","full_name":"dword-design/nuxt-content-git","owner":"dword-design","description":"Additional module for @nuxt/content that replaces or adds createdAt and updatedAt dates based on the git history.","archived":false,"fork":false,"pushed_at":"2024-05-29T05:05:32.000Z","size":1763,"stargazers_count":21,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-29T17:57:06.137Z","etag":null,"topics":["frontend","javascript","node","nodejs","npm","npm-package","nuxt","nuxt-content","nuxt-module","nuxtjs","nuxtjs-module","webdevelopment"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dword-design.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["buymeacoffee.com/dword","paypal.me/SebastianLandwehr"],"github":"dword-design","patreon":"dworddesign"}},"created_at":"2021-03-22T10:05:07.000Z","updated_at":"2024-07-18T06:58:45.927Z","dependencies_parsed_at":"2023-09-24T17:56:52.270Z","dependency_job_id":"d1a1e305-f055-4a5a-9ec3-b4a09097e034","html_url":"https://github.com/dword-design/nuxt-content-git","commit_stats":{"total_commits":200,"total_committers":9,"mean_commits":22.22222222222222,"dds":0.65,"last_synced_commit":"d998ee1f4ffdcf26ada1ab10139f5269cbc39edc"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dword-design%2Fnuxt-content-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dword-design%2Fnuxt-content-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dword-design%2Fnuxt-content-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dword-design%2Fnuxt-content-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dword-design","download_url":"https://codeload.github.com/dword-design/nuxt-content-git/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243724966,"owners_count":20337655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["frontend","javascript","node","nodejs","npm","npm-package","nuxt","nuxt-content","nuxt-module","nuxtjs","nuxtjs-module","webdevelopment"],"created_at":"2024-10-10T16:20:17.551Z","updated_at":"2025-03-15T11:31:49.171Z","avatar_url":"https://github.com/dword-design.png","language":"JavaScript","funding_links":["buymeacoffee.com/dword","paypal.me/SebastianLandwehr","https://github.com/sponsors/dword-design","https://patreon.com/dworddesign","https://www.buymeacoffee.com/dword","https://paypal.me/SebastianLandwehr","https://www.patreon.com/dworddesign"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003c!-- TITLE/ --\u003e\n# nuxt-content-git\n\u003c!-- /TITLE --\u003e\n\n\u003c!-- BADGES/ --\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://npmjs.org/package/nuxt-content-git\"\u003e\n      \u003cimg\n        src=\"https://img.shields.io/npm/v/nuxt-content-git.svg\"\n        alt=\"npm version\"\n      \u003e\n    \u003c/a\u003e\u003cimg src=\"https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue\" alt=\"Linux macOS Windows compatible\"\u003e\u003ca href=\"https://github.com/dword-design/nuxt-content-git/actions\"\u003e\n      \u003cimg\n        src=\"https://github.com/dword-design/nuxt-content-git/workflows/build/badge.svg\"\n        alt=\"Build status\"\n      \u003e\n    \u003c/a\u003e\u003ca href=\"https://codecov.io/gh/dword-design/nuxt-content-git\"\u003e\n      \u003cimg\n        src=\"https://codecov.io/gh/dword-design/nuxt-content-git/branch/master/graph/badge.svg\"\n        alt=\"Coverage status\"\n      \u003e\n    \u003c/a\u003e\u003ca href=\"https://david-dm.org/dword-design/nuxt-content-git\"\u003e\n      \u003cimg src=\"https://img.shields.io/david/dword-design/nuxt-content-git\" alt=\"Dependency status\"\u003e\n    \u003c/a\u003e\u003cimg src=\"https://img.shields.io/badge/renovate-enabled-brightgreen\" alt=\"Renovate enabled\"\u003e\u003cbr/\u003e\u003ca href=\"https://gitpod.io/#https://github.com/dword-design/nuxt-content-git\"\u003e\n      \u003cimg\n        src=\"https://gitpod.io/button/open-in-gitpod.svg\"\n        alt=\"Open in Gitpod\"\n        width=\"114\"\n      \u003e\n    \u003c/a\u003e\u003ca href=\"https://www.buymeacoffee.com/dword\"\u003e\n      \u003cimg\n        src=\"https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg\"\n        alt=\"Buy Me a Coffee\"\n        width=\"114\"\n      \u003e\n    \u003c/a\u003e\u003ca href=\"https://paypal.me/SebastianLandwehr\"\u003e\n      \u003cimg\n        src=\"https://sebastianlandwehr.com/images/paypal.svg\"\n        alt=\"PayPal\"\n        width=\"163\"\n      \u003e\n    \u003c/a\u003e\u003ca href=\"https://www.patreon.com/dworddesign\"\u003e\n      \u003cimg\n        src=\"https://sebastianlandwehr.com/images/patreon.svg\"\n        alt=\"Patreon\"\n        width=\"163\"\n      \u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- /BADGES --\u003e\n\n\u003c!-- DESCRIPTION/ --\u003e\nAdditional module for @nuxt/content that replaces or adds createdAt and updatedAt dates based on the git history.\n\u003c!-- /DESCRIPTION --\u003e\n\n\u003c!-- INSTALL/ --\u003e\n## Install\n\n```bash\n# npm\n$ npx nuxi module add nuxt-content-git\n\n# Yarn\n$ yarn nuxi module add nuxt-content-git\n```\n\u003c!-- /INSTALL --\u003e\n\n## Usage\n\nAdd the module to your `nuxt.config.js`:\n\n```js\nexport default {\n  modules: [\n    '@nuxt/content',\n    'nuxt-content-git',\n  },\n}\n```\n\nThis will set `doc.createdAt` and `doc.updatedAt` with the dates from the Git log.\n\nIt is also possible to not override the values but instead specify the field names like this:\n\n```js\nexport default {\n  modules: [\n    '@nuxt/content',\n    ['nuxt-content-git', {\n      createdAtName: 'gitCreatedAt',\n      updatedAtName: 'gitUpdatedAt',\n    }],\n  ],\n}\n```\n\nThen you can access them via `doc.gitCreatedAt` and `doc.gitUpdatedAt`.\n\n## Nuxt 2\n\nFor Nuxt 2 you need to add the module _before_ `@nuxt/content`:\n\n```js\nexport default {\n  modules: [\n    'nuxt-content-git',\n    '@nuxt/content',\n  },\n}\n```\n\n## Deployment\n\nThe module uses the Git history to calculate the dates. That is why the history also needs to be checked out when deploying the project to live. During local development the repository is usually deeply cloned. But CI systems like GitHub Actions often only do a shallow clone for performance reasons, which will result in wrong dates.\n\nTo do a deep clone in a GitHub Actions workflow, configure the checkout step the following way:\n\n```yaml\n- uses: actions/checkout\n  with:\n    fetch-depth: 0\n```\n\nKeep in mind that when deploying to static site hosters like GitHub Pages, you also need to do a deep clone on the system where you are generating the site. So do a local regular clone when generating locally, or use the config above for GitHub actions.\n\n\u003c!-- LICENSE/ --\u003e\n## Contribute\n\nAre you missing something or want to contribute? Feel free to file an [issue](https://github.com/dword-design/nuxt-content-git/issues) or a [pull request](https://github.com/dword-design/nuxt-content-git/pulls)! ⚙️\n\n## Support\n\nHey, 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:\n\n\u003cp\u003e\n  \u003ca href=\"https://www.buymeacoffee.com/dword\"\u003e\n    \u003cimg\n      src=\"https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg\"\n      alt=\"Buy Me a Coffee\"\n      width=\"114\"\n    \u003e\n  \u003c/a\u003e\u0026nbsp;If you want to send me a one time donation. The coffee is pretty good 😊.\u003cbr/\u003e\n  \u003ca href=\"https://paypal.me/SebastianLandwehr\"\u003e\n    \u003cimg\n      src=\"https://sebastianlandwehr.com/images/paypal.svg\"\n      alt=\"PayPal\"\n      width=\"163\"\n    \u003e\n  \u003c/a\u003e\u0026nbsp;Also for one time donations if you like PayPal.\u003cbr/\u003e\n  \u003ca href=\"https://www.patreon.com/dworddesign\"\u003e\n    \u003cimg\n      src=\"https://sebastianlandwehr.com/images/patreon.svg\"\n      alt=\"Patreon\"\n      width=\"163\"\n    \u003e\n  \u003c/a\u003e\u0026nbsp;Here you can support me regularly, which is great so I can steadily work on projects.\n\u003c/p\u003e\n\nThanks a lot for your support! ❤️\n\n## See also\n\n* [nuxt-content-body-html](https://github.com/dword-design/nuxt-content-body-html): Embed a Mermaid diagram in a Nuxt.js app by providing its diagram string.\n* [nuxt-mail](https://github.com/dword-design/nuxt-mail): Adds email sending capability to a Nuxt.js app. Adds a server route, an injected variable, and uses nodemailer to send emails.\n* [nuxt-route-meta](https://github.com/dword-design/nuxt-route-meta): Adds Nuxt page data to route meta at build time.\n* [nuxt-modernizr](https://github.com/dword-design/nuxt-modernizr): Adds a Modernizr build to your Nuxt.js app.\n* [nuxt-mermaid-string](https://github.com/dword-design/nuxt-mermaid-string): Embed a Mermaid diagram in a Nuxt.js app by providing its diagram string.\n\n## License\n\n[MIT License](https://opensource.org/license/mit/) © [Sebastian Landwehr](https://sebastianlandwehr.com)\n\u003c!-- /LICENSE --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdword-design%2Fnuxt-content-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdword-design%2Fnuxt-content-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdword-design%2Fnuxt-content-git/lists"}