mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
urls.static_plugins() method, closes #1033
Also documented how to package static assets and templates in plugins, closes #575
This commit is contained in:
parent
7f728d4a37
commit
10c35bd371
4 changed files with 67 additions and 5 deletions
|
|
@ -387,6 +387,14 @@ The ``datasette.urls`` object contains methods for building URLs to pages within
|
|||
``datasette.urls.logout()``
|
||||
Returns the URL to the logout page, usually ``"/-/logout"``.
|
||||
|
||||
``datasette.urls.static(path)``
|
||||
Returns the URL of one of Datasette's default static assets, for example ``"/-/static/app.css"``.
|
||||
|
||||
``datasette.urls.static_plugins(plugin_name, path)``
|
||||
Returns the URL of one of the static assets belonging to a plugin.
|
||||
|
||||
``datasette.url.static_plugins("datasette_cluster_map", "datasette-cluster-map.js")`` would return ``"/-/static-plugins/datasette_cluster_map/datasette-cluster-map.js"``.
|
||||
|
||||
``datasette.urls.database(database_name)``
|
||||
Returns the URL to a database page, for example ``"/fixtures"``
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue