mirror of
https://github.com/Cian-H/am-d-model.eu.git
synced 2025-12-22 21:41:57 +00:00
Added customisation plugin to invenio instance
This commit is contained in:
5
invenio/Dockerfile
Normal file
5
invenio/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM ghcr.io/front-matter/invenio-rdm-starter:v12.0.13.4
|
||||
|
||||
RUN /opt/invenio/.venv/bin/python -m ensurepip
|
||||
RUN /opt/invenio/.venv/bin/python -m pip install -e /opt/invenio/var/instance/static/plugin
|
||||
RUN /opt/invenio/.venv/bin/python -m pip uninstall -e pip
|
||||
BIN
invenio/assets/ESAFORM_AM-D-Model_logo.webp
Normal file
BIN
invenio/assets/ESAFORM_AM-D-Model_logo.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
10
invenio/plugin/__init__.py
Normal file
10
invenio/plugin/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from flask import Blueprint
|
||||
|
||||
|
||||
def init_app(app):
|
||||
"""Initialize application."""
|
||||
app.register_blueprint(views.blueprint)
|
||||
return app
|
||||
|
||||
|
||||
from . import views
|
||||
12
invenio/plugin/setup.py
Normal file
12
invenio/plugin/setup.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name="custom_invenio_plugin",
|
||||
version="0.1.0",
|
||||
packages=["custom_invenio_plugin"],
|
||||
entry_points={
|
||||
"invenio_base.apps": [
|
||||
"custom_menu = custom_invenio_plugin:init_app",
|
||||
],
|
||||
},
|
||||
)
|
||||
17
invenio/plugin/views.py
Normal file
17
invenio/plugin/views.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from flask import Blueprint
|
||||
from flask_menu import current_menu
|
||||
|
||||
blueprint = Blueprint(
|
||||
"custom_menu",
|
||||
__name__,
|
||||
)
|
||||
|
||||
|
||||
@blueprint.before_app_first_request
|
||||
def init_menu():
|
||||
"""Add custom items to main menu."""
|
||||
current_menu.submenu("main").register(
|
||||
"About AM-D-Model",
|
||||
"https://am-d-model.eu",
|
||||
order=0,
|
||||
)
|
||||
Reference in New Issue
Block a user