Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pr discuss] Add {{git_creation_date_localized}} #49

Closed
PegasisForever opened this issue Mar 24, 2021 · 2 comments
Closed

[pr discuss] Add {{git_creation_date_localized}} #49

PegasisForever opened this issue Mar 24, 2021 · 2 comments

Comments

@PegasisForever
Copy link
Contributor

Hi!

I added the ability for this plugin to add creation dates to pages. (Because I need it for my personal blog) (repo)

Since CONTRIBUTING.md wrote "...That means not extending the functionality of this plugin", I'm wondering whether my pr of adding this functionality will be accepted?

If it won't, I won't bother writing tests for it :)

@timvink
Copy link
Owner

timvink commented Mar 26, 2021

Hi @PegasisForever !

Thanks for this :) I had a look at the changes you made link and looks nice!

I'm open to adding a git_creation_date_localized. It's relatively cheap, because it just means a bit more parsing of the git log output we already have. Some thoughts:

  • I wonder what the performance overhead is of getting the full logs instead of just the top one for large projects (see here). Probably better to only get the full logs when you need it (so when enable_creation_date is True), otherwise keep n=1.
  • mkdocs-material offers native support for git-revision-date-localized including all required translations (see f.e. here or here). We'll have to align with the author, update the source_date partial and language templates. Would you be willing to pick that up also?

We can align on implementation specifics if you open a PR. I have been planning to create a documentation website for this plugin, I will pick that up so we can document this feature there.

@PegasisForever
Copy link
Contributor Author

Performance:

I found out git log has an reverse option so we can just get the first log in the reverse order.

Theme integration:

Yes, I'll deal with that.

I'll open a pr later today (or tomorrow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants