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

HTML comments specifying custom templates for page #171

Closed
simonw opened this issue Dec 9, 2017 · 1 comment
Closed

HTML comments specifying custom templates for page #171

simonw opened this issue Dec 9, 2017 · 1 comment

Comments

@simonw
Copy link
Owner

simonw commented Dec 9, 2017

This would make the custom templating system self-documenting, and save people from having to figure out the right template names for customizing specific pages.

@simonw simonw added this to the Custom templates edition milestone Dec 9, 2017
@simonw simonw closed this as completed in 7126d08 Dec 9, 2017
@simonw
Copy link
Owner Author

simonw commented Dec 9, 2017

Quoting the new documentation:

You can find out which templates were considered for a specific page by viewing
source on that page and looking for an HTML comment at the bottom. The comment
will look something like this:

<!-- Templates considered: *query-mydb-tz.html, query-mydb.html, query.html -->

This example is from the canned query page for a query called "tz" in the
database called "mydb". The asterisk shows which template was selected - so in
this case, Datasette found a template file called query-mydb-tz.html and
used that - but if that template had not been found, it would have tried for
query-mydb.html or the default query.html.

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

No branches or pull requests

1 participant