mkdocs-document-dates 0.1.0__tar.gz → 0.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.
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/PKG-INFO +3 -3
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/README.md +2 -2
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates/plugin.py +13 -2
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates.egg-info/PKG-INFO +3 -3
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/setup.py +1 -1
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/LICENSE +0 -0
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates/__init__.py +0 -0
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates.egg-info/SOURCES.txt +0 -0
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates.egg-info/dependency_links.txt +0 -0
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates.egg-info/entry_points.txt +0 -0
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates.egg-info/requires.txt +0 -0
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates.egg-info/top_level.txt +0 -0
- {mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: mkdocs-document-dates
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0
|
4
4
|
Summary: 一个用于显示文档创建日期和最后修改日期的 MkDocs 插件
|
5
5
|
Home-page: https://github.com/jaywhj/mkdocs-document-dates
|
6
6
|
Author: Aaron Wang
|
@@ -78,8 +78,8 @@ plugins:
|
|
78
78
|
|
79
79
|
```yaml
|
80
80
|
---
|
81
|
-
created_date:
|
82
|
-
modified_date:
|
81
|
+
created_date: 2023-01-01
|
82
|
+
modified_date: 2023-12-31
|
83
83
|
---
|
84
84
|
|
85
85
|
# 文档标题
|
@@ -103,9 +103,20 @@ class DocumentDatesPlugin(BasePlugin):
|
|
103
103
|
# 检查 frontmatter 中的日期
|
104
104
|
meta = getattr(page, 'meta', {})
|
105
105
|
if 'created_date' in meta:
|
106
|
-
|
106
|
+
try:
|
107
|
+
date_str = str(meta['created_date']).strip("'\"") # 移除可能存在的引号
|
108
|
+
created = datetime.fromisoformat(date_str)
|
109
|
+
except (ValueError, TypeError):
|
110
|
+
# 如果解析失败,保持原有的文件系统日期
|
111
|
+
pass
|
112
|
+
|
107
113
|
if 'modified_date' in meta:
|
108
|
-
|
114
|
+
try:
|
115
|
+
date_str = str(meta['modified_date']).strip("'\"") # 移除可能存在的引号
|
116
|
+
modified = datetime.fromisoformat(date_str)
|
117
|
+
except (ValueError, TypeError):
|
118
|
+
# 如果解析失败,保持原有的文件系统日期
|
119
|
+
pass
|
109
120
|
|
110
121
|
# 格式化并插入日期信息
|
111
122
|
date_info = self.format_date_info(created, modified)
|
{mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates.egg-info/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: mkdocs-document-dates
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0
|
4
4
|
Summary: 一个用于显示文档创建日期和最后修改日期的 MkDocs 插件
|
5
5
|
Home-page: https://github.com/jaywhj/mkdocs-document-dates
|
6
6
|
Author: Aaron Wang
|
@@ -78,8 +78,8 @@ plugins:
|
|
78
78
|
|
79
79
|
```yaml
|
80
80
|
---
|
81
|
-
created_date:
|
82
|
-
modified_date:
|
81
|
+
created_date: 2023-01-01
|
82
|
+
modified_date: 2023-12-31
|
83
83
|
---
|
84
84
|
|
85
85
|
# 文档标题
|
File without changes
|
{mkdocs_document_dates-0.1.0 → mkdocs_document_dates-0.2.0}/mkdocs_document_dates/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|