Skip to content

Correctly check for truthiness of generated_by #124

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

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mkdocs_git_revision_date_localized_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def on_page_markdown(

# Retrieve git commit timestamp
# Except for generated pages (f.e. by mkdocs-gen-files plugin)
if hasattr(page.file, "generated_by"):
if getattr(page.file, "generated_by", None):
last_revision_timestamp = int(time.time())
else:
last_revision_timestamp = self.util.get_git_commit_timestamp(
Expand Down Expand Up @@ -258,7 +258,7 @@ def on_page_markdown(

# Retrieve git commit timestamp
# Except for generated pages (f.e. by mkdocs-gen-files plugin)
if hasattr(page.file, "generated_by"):
if getattr(page.file, "generated_by", None):
first_revision_timestamp = int(time.time())
else:
first_revision_timestamp = self.util.get_git_commit_timestamp(
Expand Down