nolebase/integrations

Bug (git-changelog): Attempting to display authors of non-existent md's

Closed this issue · 2 comments

When creating a new file without publishing to github - trying to display a log that doesn't exist, instead of "No change log" and "No contributors"

image

System:

  • vitepress - v1.1.4
  • git-changelog - 2.0.0-rc13

Not critical issue, but I don't think this is the right behavior.

I don't think so, it's a Git-based file changelog plugin, and when a file has no Git commits, its Git log is obviously empty, so showing No Changelogs and No Contributors doesn't seem wrong to me.

Other SSGs like VuePress have similar behavior:

https://theme-hope.vuejs.press/guide/feature/meta.html#git-based-information
https://ecosystem.vuejs.press/zh/plugins/git.html
Since the contributors, last update time, and file creation time information are based on git, you can only enable it in a git based project.
Since related information are from git commits, they will only be displayed after the first commit for a given page, and will only be updated when some commits change that page.

For authors, I have ideas:

There could be support for reading the author field from front Matter and displaying them always in Contributors, and this feature could perhaps support setting a default author. Of course, this may be a discussion for another issue.

@northword this is a bug. Unhandled empty string stdout will cause invalid and empty parsed commit.

Will be fixed on #221 .