Skip to content

Commit

Permalink
global: add meta generator tag
Browse files Browse the repository at this point in the history
* closes #2689
  • Loading branch information
ntarocco authored and kpsherva committed Jun 25, 2024
1 parent 1e207e7 commit 0002091
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 @@ -230,6 +230,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 0002091

Please sign in to comment.