invenio-theme

raw JSON →
4.7.0 verified Fri May 01 auth: no python

Invenio standard theme for the Invenio digital library framework. It provides base templates, CSS/JS assets, and theming utilities. Version 4.7.0 requires Python >=3.7. Released infrequently; follows Invenio major releases.

pip install invenio-theme
error ModuleNotFoundError: No module named 'invenio_theme.ext'
cause You are using an old import path from before version 2.0.
fix
Replace from invenio_theme.ext import InvenioTheme with from invenio_theme import InvenioTheme.
error jinja2.exceptions.TemplateNotFound: invenio_theme/page.html
cause The base template was renamed or removed in a newer version.
fix
Check your template inheritance: use invenio_theme/page_admin.html for admin pages or invenio_theme/page_front.html for public pages.
breaking From version 2.0, the import path changed from `invenio_theme.ext` to `invenio_theme`. Old imports will fail.
fix Use `from invenio_theme import InvenioTheme` instead of `from invenio_theme.ext import InvenioTheme`.
deprecated The `theme.base` template no longer extends `invenio_theme/page.html`; it now extends `invenio_theme/page_admin.html`. Custom templates targeting the old base will break.
fix Update your Jinja template inheritance to extend `invenio_theme/page_admin.html` or `invenio_theme/page_front.html` as appropriate.
gotcha The package silently requires Flask-BabelEx if you use translations. Missing it causes a `ModuleNotFoundError` at import.
fix Install Flask-BabelEx: `pip install Flask-BabelEx`.

Initialize InvncioTheme on a Flask application.

from flask import Flask
from invenio_theme import InvenioTheme

app = Flask(__name__)
InvenioTheme(app)

@app.route('/')
def index():
    return '<h1>Hello Invenio Theme</h1>'

if __name__ == '__main__':
    app.run()