File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
mkdocs_git_revision_date_localized_plugin Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,6 @@ class GitRevisionDateLocalizedPlugin(BasePlugin):
1818 ("type" , config_options .Type (str , default = "date" )),
1919 )
2020
21- def __init__ (self ):
22- self .util = Util ()
23-
2421 def on_config (self , config : config_options .Config ) -> dict :
2522 """
2623 Determine which locale to use.
@@ -36,6 +33,7 @@ def on_config(self, config: config_options.Config) -> dict:
3633 Returns:
3734 dict: global configuration object
3835 """
36+ self .util = Util (path = config ["docs_dir" ])
3937
4038 # Get locale settings - might be added in future mkdocs versions
4139 # see: https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/issues/24
@@ -161,11 +159,3 @@ def on_page_markdown(
161159 markdown ,
162160 flags = re .IGNORECASE ,
163161 )
164-
165-
166- # ##############################################################################
167- # ##### Stand alone program ########
168- # ##################################
169- if __name__ == "__main__" :
170- """Standalone execution and quick tests."""
171- pass
Original file line number Diff line number Diff line change 66
77# 3rd party
88from babel .dates import format_date
9- from git import Git , GitCommandError , GitCommandNotFound
9+ from git import Repo , Git , GitCommandError , GitCommandNotFound
1010
1111
1212class Util :
1313 def __init__ (self , path : str = "." ):
14- self .repo = Git (path )
14+ git_repo = Repo (path , search_parent_directories = True )
15+ self .repo = git_repo .git
1516
1617 # Checks when running builds on CI
1718 # See https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/issues/10
You can’t perform that action at this time.
0 commit comments