observablehq / framework

A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
https://observablehq.com/framework/
ISC License
2.41k stars 110 forks source link

cleanUrls set to false do not change the home page link #1479

Closed massyn closed 3 months ago

massyn commented 3 months ago

When setting the observablehq.config.jq file with the cleanUrls option to False, per https://observablehq.com/framework/config#cleanurls.

The documentation states:

Whether page links should be “clean”, i.e., formatted without a .html extension. Defaults to true. If true, a link to config.html will be formatted as config. Regardless of this setting, a link to an index page will drop the implied index.html; for example foo/index.html will be formatted as foo/.

While deploying the dashboard on an AWS S3 bucket with CloudFront, the fact that the home page is not linked to index.html is causing an 404 error. The behaviour of cleanUrls will need to be updated so that when cleanUrls is set to False, it needs to render the foo/ link as foo/index.html to allow the web server to still serve the page, even when index.html is not the default page to be served.

mootari commented 3 months ago

As far as I can tell that's working as designed. I suspect you need to configure an index document for your bucket: https://docs.aws.amazon.com/AmazonS3/latest/userguide/IndexDocumentSupport.html