Skip to content

Commit

Permalink
Docs: use release date instead of "today" in the index page
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodsf committed Oct 28, 2024
1 parent e90fe83 commit 6d6e4bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# pylint: disable=wrong-import-position,invalid-name
import sys
import os
from datetime import datetime
import sphinxcontrib.katex as katex
sys.path.insert(0, os.path.abspath('.'))
from write_configfile import write_configfile # noqa
Expand All @@ -14,7 +15,7 @@
sys.path.insert(0, os.path.join(os.path.abspath('..'), 'requake'))
from requake._version import get_versions # NOQA
__version__ = get_versions()['version']

__release_date__ = get_versions()['date']

# -- Project information -----------------------------------------------------

Expand All @@ -30,6 +31,11 @@
# The short X.Y version.
version = release.split('-')[0]

# Release date in the format "Month DD, YYYY"
release_date = datetime.strptime(
__release_date__, '%Y-%m-%dT%H:%M:%S%z'
).strftime('%b %d, %Y')
rst_epilog = f'\n.. |release date| replace:: {release_date}'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Repeating earthquakes search and analysis.

:Copyright: 2021-2024 Claudio Satriano [email protected]
:Release: |release|
:Date: |today|
:Date: |release date|

Description
-----------
Expand Down

0 comments on commit 6d6e4bd

Please sign in to comment.