simonw / datasette

An open source multi-tool for exploring and publishing data
https://datasette.io
Apache License 2.0
9.47k stars 677 forks source link

Featured table(s) on the homepage #1810

Open simonw opened 2 years ago

simonw commented 2 years ago

Many Datasette instances mainly exist to serve a single table - for example:

It would be neat if the / homepage of those instances could be configured to highlight that specific table.

Or maybe more than one?

simonw commented 2 years ago

Twitter conversation that inspired this issue: https://twitter.com/psychemedia/status/1570410108785684481

psychemedia commented 2 years ago

A couple+ of possible use case examples:

In many cases, I suspect the raw content will be in one table, but the search table will be a second (eg FTS) table. Generally, the search may be over one or more joined tables, and the results constructed from one or more tables (which may or may not be distinct from the search tables).

simonw commented 2 years ago

Idea: allow the user to specify one or more featured tables. Each table is then shown as a summary on the homepage - with the total number of rows and the first 5 rows. If the table has search configured there's a search box too.

If the instance has only one database with only one table (excluding hidden tables) it gets featured automatically perhaps (maybe with a way to opt-out of that if you want to).

simonw commented 2 years ago

I could prototype this idea as a datasette-featured-tables plugin that delivers its own custom index.html template.