mkdocs-document-dates 2.1.0__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/PKG-INFO +3 -3
  2. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/README.md +2 -2
  3. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/plugin.py +4 -4
  4. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates.egg-info/PKG-INFO +3 -3
  5. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/setup.py +1 -1
  6. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/LICENSE +0 -0
  7. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/__init__.py +0 -0
  8. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/hooks/pre-commit +0 -0
  9. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/hooks_installer.py +0 -0
  10. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/__init__.py +0 -0
  11. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/ar.py +0 -0
  12. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/de.py +0 -0
  13. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/en.py +0 -0
  14. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/es.py +0 -0
  15. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/fr.py +0 -0
  16. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/ja.py +0 -0
  17. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/ko.py +0 -0
  18. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/ru.py +0 -0
  19. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/zh.py +0 -0
  20. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/lang/zh_tw.py +0 -0
  21. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates/styles.py +0 -0
  22. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates.egg-info/SOURCES.txt +0 -0
  23. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates.egg-info/dependency_links.txt +0 -0
  24. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates.egg-info/entry_points.txt +0 -0
  25. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates.egg-info/requires.txt +0 -0
  26. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/mkdocs_document_dates.egg-info/top_level.txt +0 -0
  27. {mkdocs_document_dates-2.1.0 → mkdocs_document_dates-2.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mkdocs-document-dates
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: A MkDocs plugin for displaying accurate document creation and last modification dates.
5
5
  Home-page: https://github.com/jaywhj/mkdocs-document-dates
6
6
  Author: Aaron Wang
@@ -112,10 +112,10 @@ modified: 2023-12-31
112
112
  - Linux: Uses modification time as creation time due to system limitations, if you need the exact creation time, you can manually specify it in Front Matter
113
113
  - It still works when using CI/CD build systems (e.g. Github Actions)
114
114
  - Used a cache file `.dates_cache.json` to solve this problem
115
- - You can configure it like this: `pip install --upgrade mkdocs-document-dates`
115
+ - You can configure it like this:
116
116
  ```
117
117
  ...
118
118
 
119
- - run: pip install --upgrade mkdocs-document-dates
119
+ - run: pip install mkdocs-document-dates
120
120
  - run: mkdocs gh-deploy --force
121
121
  ```
@@ -90,10 +90,10 @@ modified: 2023-12-31
90
90
  - Linux: Uses modification time as creation time due to system limitations, if you need the exact creation time, you can manually specify it in Front Matter
91
91
  - It still works when using CI/CD build systems (e.g. Github Actions)
92
92
  - Used a cache file `.dates_cache.json` to solve this problem
93
- - You can configure it like this: `pip install --upgrade mkdocs-document-dates`
93
+ - You can configure it like this:
94
94
  ```
95
95
  ...
96
96
 
97
- - run: pip install --upgrade mkdocs-document-dates
97
+ - run: pip install mkdocs-document-dates
98
98
  - run: mkdocs gh-deploy --force
99
99
  ```
@@ -85,7 +85,7 @@ class DocumentDatesPlugin(BasePlugin):
85
85
  return markdown
86
86
 
87
87
  # 获取文件时间
88
- created, modified = self._get_file_dates(file_path)
88
+ created, modified = self._get_file_dates(file_path, config) # 传入 config
89
89
 
90
90
  # 处理 front matter 中的时间
91
91
  created, modified = self._process_meta_dates(page.meta, created, modified)
@@ -151,11 +151,11 @@ class DocumentDatesPlugin(BasePlugin):
151
151
  except (ValueError, TypeError):
152
152
  return default_date
153
153
 
154
- def _get_file_dates(self, file_path):
154
+ def _get_file_dates(self, file_path, config): # 添加 config 参数
155
155
  """获取文件的创建时间和修改时间"""
156
156
  try:
157
- # 获取文件的相对路径(相对于 docs 目录)
158
- docs_dir = Path(self.config['docs_dir'])
157
+ # 从传入的 config 中获取 docs_dir
158
+ docs_dir = Path(config['docs_dir'])
159
159
  rel_path = str(Path(file_path).relative_to(docs_dir))
160
160
 
161
161
  # 尝试从缓存文件读取时间信息
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mkdocs-document-dates
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: A MkDocs plugin for displaying accurate document creation and last modification dates.
5
5
  Home-page: https://github.com/jaywhj/mkdocs-document-dates
6
6
  Author: Aaron Wang
@@ -112,10 +112,10 @@ modified: 2023-12-31
112
112
  - Linux: Uses modification time as creation time due to system limitations, if you need the exact creation time, you can manually specify it in Front Matter
113
113
  - It still works when using CI/CD build systems (e.g. Github Actions)
114
114
  - Used a cache file `.dates_cache.json` to solve this problem
115
- - You can configure it like this: `pip install --upgrade mkdocs-document-dates`
115
+ - You can configure it like this:
116
116
  ```
117
117
  ...
118
118
 
119
- - run: pip install --upgrade mkdocs-document-dates
119
+ - run: pip install mkdocs-document-dates
120
120
  - run: mkdocs gh-deploy --force
121
121
  ```
@@ -7,7 +7,7 @@ try:
7
7
  except FileNotFoundError:
8
8
  long_description = "A MkDocs plugin for displaying accurate document creation and last modification dates."
9
9
 
10
- VERSION = '2.1.0'
10
+ VERSION = '2.2.0'
11
11
 
12
12
  setup(
13
13
  name="mkdocs-document-dates",