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 3, 2024
1 parent 9dd290d commit 30b0c3f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 36 deletions.
10 changes: 8 additions & 2 deletions invenio_theme/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,16 @@
THEME_ERROR_TEMPLATE = "invenio_theme/page_error.html"
"""Base template for error pages."""

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

THEME_GOOGLE_SITE_VERIFICATION = []
"""List of Google Site Verification tokens to be used.
This adds the Google Site Verfication into the meta tags of all pages.
This adds the Google Site Verification into the meta tags of all pages.
"""

THEME_LOGO = "images/invenio-white.svg"
Expand All @@ -101,7 +107,7 @@
"""Enable or disable basic frontpage view."""

THEME_FRONTPAGE_TITLE = _("Invenio")
"""The title shown on the fronpage."""
"""The title shown on the frontpage."""

THEME_FRONTPAGE_TEMPLATE = "invenio_theme/frontpage.html"
"""Template for front page."""
Expand Down
3 changes: 3 additions & 0 deletions invenio_theme/templates/invenio_theme/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<meta name="google-site-verification" content="{{google_id}}"/>
{%- endfor %}
{%- endif %}
{%- if config.get('THEME_GENERATOR', None) %}
<meta name="generator" content="{{ config.THEME_GENERATOR }}"/>
{%- endif %}
{%- endblock head_meta %}
{%- block head_title %}
{%- set title = title or _(config.THEME_SITENAME) or _('Invenio') %}
Expand Down
27 changes: 15 additions & 12 deletions invenio_theme/templates/invenio_theme/page_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
<head>
{%- block head %}
{%- block head_meta %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- if description %}
<meta name="description" content="{{ description }}"/>{% endif %}
{%- if keywords %}
<meta name="keywords" content="{{ keywords }}"/>{% endif %}
{%- if config.get('THEME_GOOGLE_SITE_VERIFICATION', None) %}
{%- for google_id in config.THEME_GOOGLE_SITE_VERIFICATION %}
<meta name="google-site-verification" content="{{ google_id }}"/>
{%- endfor %}
{%- endif %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- if description %}
<meta name="description" content="{{ description }}"/>{% endif %}
{%- if keywords %}
<meta name="keywords" content="{{ keywords }}"/>{% endif %}
{%- if config.get('THEME_GOOGLE_SITE_VERIFICATION', None) %}
{%- for google_id in config.THEME_GOOGLE_SITE_VERIFICATION %}
<meta name="google-site-verification" content="{{ google_id }}"/>
{%- endfor %}
{%- endif %}
{%- if config.get('THEME_GENERATOR', None) %}
<meta name="generator" content="{{ config.THEME_GENERATOR }}"/>
{%- endif %}
{%- endblock head_meta %}
{%- block head_title %}
{%- set title = title or _(config.THEME_SITENAME) or _('Invenio') %}
Expand Down
23 changes: 13 additions & 10 deletions invenio_theme/templates/semantic-ui/invenio_theme/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
{%- block head %}

{%- block head_meta %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- if description %}<meta name="description" content="{{ description }}" />{% endif %}
{%- if keywords %}<meta name="keywords" content="{{ keywords }}" />{% endif %}
{%- if config.get('THEME_GOOGLE_SITE_VERIFICATION', None) %}
{%- for google_id in config.THEME_GOOGLE_SITE_VERIFICATION %}
<meta name="google-site-verification" content="{{google_id}}"/>
{%- endfor %}
{%- endif %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- if description %}<meta name="description" content="{{ description }}" />{% endif %}
{%- if keywords %}<meta name="keywords" content="{{ keywords }}" />{% endif %}
{%- if config.get('THEME_GOOGLE_SITE_VERIFICATION', None) %}
{%- for google_id in config.THEME_GOOGLE_SITE_VERIFICATION %}
<meta name="google-site-verification" content="{{google_id}}"/>
{%- endfor %}
{%- endif %}
{%- if config.get('THEME_GENERATOR', None) %}
<meta name="generator" content="{{ config.THEME_GENERATOR }}"/>
{%- endif %}
{%- endblock head_meta %}

{%- block head_title %}
Expand Down
27 changes: 15 additions & 12 deletions invenio_theme/templates/semantic-ui/invenio_theme/page_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
<head>
{%- block head %}
{%- block head_meta %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- if description %}
<meta name="description" content="{{ description }}"/>{% endif %}
{%- if keywords %}
<meta name="keywords" content="{{ keywords }}"/>{% endif %}
{%- if config.get('THEME_GOOGLE_SITE_VERIFICATION', None) %}
{%- for google_id in config.THEME_GOOGLE_SITE_VERIFICATION %}
<meta name="google-site-verification" content="{{ google_id }}"/>
{%- endfor %}
{%- endif %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- if description %}
<meta name="description" content="{{ description }}"/>{% endif %}
{%- if keywords %}
<meta name="keywords" content="{{ keywords }}"/>{% endif %}
{%- if config.get('THEME_GOOGLE_SITE_VERIFICATION', None) %}
{%- for google_id in config.THEME_GOOGLE_SITE_VERIFICATION %}
<meta name="google-site-verification" content="{{ google_id }}"/>
{%- endfor %}
{%- endif %}
{%- if config.get('THEME_GENERATOR', None) %}
<meta name="generator" content="{{ config.THEME_GENERATOR }}"/>
{%- endif %}
{%- endblock head_meta %}
{%- block head_title %}
{%- set title = title or _(config.THEME_SITENAME) or _('Invenio') %}
Expand Down

0 comments on commit 30b0c3f

Please sign in to comment.