Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra_js_urls and extra_css_urls should respect base_url setting #1041

Closed
simonw opened this issue Oct 22, 2020 · 4 comments
Closed

extra_js_urls and extra_css_urls should respect base_url setting #1041

simonw opened this issue Oct 22, 2020 · 4 comments
Milestone

Comments

@simonw
Copy link
Owner

simonw commented Oct 22, 2020

Originally posted by @simonw in #1033 (comment)

Refs #1023

@simonw
Copy link
Owner Author

simonw commented Oct 22, 2020

@psychemedia said: #1033 (comment)

How does /-/static relate to current guidance docs around static regarding the --static option and metadata formulations such as "extra_js_urls": [ "/static/app.js"] (I've not managed to get this to work in a Jupyter server proxied set up; the datasette / jupyter server proxy repo may provide a useful test example, eg via MyBinder, for folk to crib from?)

@simonw
Copy link
Owner Author

simonw commented Oct 22, 2020

I'll need to update these docs once there's a solution for this in place: https://docs.datasette.io/en/latest/custom_templates.html#serving-static-files

@simonw
Copy link
Owner Author

simonw commented Oct 22, 2020

I think I'll do this by looking for URLs that start with / - since it's also possible to have full https://... URLs in that setting.

{
    "extra_css_urls": [
        "/static/styles.css"
    ],
    "extra_js_urls": [
        "/static/app.js"
    ]
}

I need to think about the extra_css_urls and extra_js_urls plugin hooks too: https://docs.datasette.io/en/stable/plugin_hooks.html#extra-css-urls-template-database-table-columns-view-name-request-datasette

@simonw
Copy link
Owner Author

simonw commented Oct 31, 2020

Implemented in a4ca26a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant