inveniosoftware / invenio-pages

Invenio module that adds support for static pages.
https://invenio-pages.readthedocs.io
MIT License
2 stars 20 forks source link

Urls registered under same endpoint name #61

Open jrcastro2 opened 1 year ago

jrcastro2 commented 1 year ago

Comment/shelve: Since we are still in setup mode at this point, isn't it possible to use current_app.add_url_rule here like before? I suspect it's because of this check. Which is a valid check in the sense that if you did url_for("invenio_pages.view"), you would probably get a random URL back?

In any case, I think the best would be to have unique human-friendly endpoint names for each page rule and point them all to the invenio_pages.views.view function. But this unique key is not currently part of the Page model, so that would mean opening a can of worms and updating the alembic recipes, etc.

The above also means that there's no way to do something like url_for("about_page") to get the URL for a page.

So maybe we just open an issue and revisit in the future to add this as a feature.

_Originally posted by @slint in https://github.com/inveniosoftware/invenio-pages/pull/60#discussion_r1068382370_

ntarocco commented 7 months ago

Decision: