Skip to content

Commit e828442

Browse files
committed
assets: fix missing configuration for theme.js
1 parent a5e65d3 commit e828442

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

invenio_app_rdm/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _(x):
262262
"""Footer base template."""
263263

264264
THEME_FRONTPAGE = False
265-
"""Use default frontpage."""
265+
"""Use default theme frontpage."""
266266

267267
THEME_FRONTPAGE_TITLE = _("The turn-key research data management repository")
268268
"""Frontpage title."""

invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/theme.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,15 @@ const handleAuthButtonClick = () => {
134134

135135
$authButton.on({ click: handleAuthButtonClick });
136136

137-
const invenioConfig = JSON.parse(document.body.dataset.invenioConfig);
138-
const isMathJaxEnabled = invenioConfig?.isMathJaxEnabled;
139-
if (window.invenio) {
140-
window.invenio.onSearchResultsRendered = () => {
141-
if (isMathJaxEnabled) {
142-
// Re-render mathematical content on the page using MathJax.
143-
return window.MathJax?.typeset();
144-
}
145-
};
137+
if (document.body.dataset.invenioConfig) {
138+
const invenioConfig = JSON.parse(document.body.dataset.invenioConfig);
139+
const isMathJaxEnabled = invenioConfig?.isMathJaxEnabled;
140+
if (window.invenio) {
141+
window.invenio.onSearchResultsRendered = () => {
142+
if (isMathJaxEnabled) {
143+
// Re-render mathematical content on the page using MathJax.
144+
return window.MathJax?.typeset();
145+
}
146+
};
147+
}
146148
}

invenio_app_rdm/theme/views.py

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def create_blueprint(app):
4343
template_folder="templates",
4444
static_folder="static",
4545
)
46-
4746
blueprint.add_url_rule(**create_url_rule(routes["index"], default_view_func=index))
4847
blueprint.add_url_rule(
4948
**create_url_rule(routes["robots"], default_view_func=robots)

0 commit comments

Comments
 (0)