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):
18
18
("type" , config_options .Type (str , default = "date" )),
19
19
)
20
20
21
- def __init__ (self ):
22
- self .util = Util ()
23
-
24
21
def on_config (self , config : config_options .Config ) -> dict :
25
22
"""
26
23
Determine which locale to use.
@@ -36,6 +33,7 @@ def on_config(self, config: config_options.Config) -> dict:
36
33
Returns:
37
34
dict: global configuration object
38
35
"""
36
+ self .util = Util (path = config ["docs_dir" ])
39
37
40
38
# Get locale settings - might be added in future mkdocs versions
41
39
# see: https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/issues/24
@@ -161,11 +159,3 @@ def on_page_markdown(
161
159
markdown ,
162
160
flags = re .IGNORECASE ,
163
161
)
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 6
6
7
7
# 3rd party
8
8
from babel .dates import format_date
9
- from git import Git , GitCommandError , GitCommandNotFound
9
+ from git import Repo , Git , GitCommandError , GitCommandNotFound
10
10
11
11
12
12
class Util :
13
13
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
15
16
16
17
# Checks when running builds on CI
17
18
# 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