Skip to content

Commit

Permalink
Merge pull request #124 from oprypin/patch-2
Browse files Browse the repository at this point in the history
Correctly check for truthiness of `generated_by`
  • Loading branch information
timvink authored Nov 11, 2023
2 parents 1116144 + c255498 commit d528007
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit d528007

Please sign in to comment.