Skip to content

Commit

Permalink
global: add meta generator tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ntarocco committed Jun 21, 2024
1 parent 765f661 commit a95959c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions invenio_app_rdm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,30 @@ def _(x):
THEME_HEADER_LOGIN_TEMPLATE = "invenio_app_rdm/header_login.html"
"""Header login base template."""


def _get_package_version():
from importlib.metadata import PackageNotFoundError, version

from packaging.version import Version

try:
package_version = version("invenio-app-rdm")
parsed_version = Version(package_version)
major_minor_version = (
f"InvenioRDM {parsed_version.major}.{parsed_version.minor}"
)
return major_minor_version
except PackageNotFoundError:
# default without any version
return "InvenioRDM"


THEME_GENERATOR = _get_package_version()
"""Generator meta tag to identify the software that generated the page.
Set it to `None` to disable the tag.
"""

THEME_LOGO = "images/invenio-rdm.svg"
"""Theme logo."""

Expand Down

0 comments on commit a95959c

Please sign in to comment.