-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: add demo site landing page, with sponsor logo in footer #14
Conversation
run-demo: | ||
datasette -i demo/happy_planet_index.db \ | ||
${DATASETTE_DEMO_FLAGS} | ||
# --template-dir=demo/demo-templates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented this out because overriding base.html
had no effect. Only full pages or the "row" partial can be overridden.
https://docs.datasette.io/en/stable/custom_templates.html#custom-templates
@@ -0,0 +1,28 @@ | |||
// Append footer with the Vercel logo to every page. | |||
// TODO: Check if there a way to server-side render this someday? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be much better to run all of this once on the server side at compile time, but the execution cost is negligible so I'll leave it as is for now. Note that the resulting HTML string is constant every time, so we could technically preval sponsorContainer
once, and use it the same string everywhere.
{% block content %} | ||
{{ super() }} | ||
<footer> | ||
<h1>Unused: theoretically this could be a custom footer</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This didn't work, but I'd imagine a future extension to the Datasette API might look something like this.
@@ -0,0 +1 @@ | |||
<h1>hello world - a custom template</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This template does work (it'll replace your homepage).
title: | ||
Datasette Nteract Data Explorer Demo | ||
|
||
description_html: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this string by default with an optional _html
extension API. If these blocks get longer, I'll store the description in markdown somewhere, and convert them to HTML in a build step.
3a04702
to
5c019df
Compare
Motivation
To host the demo for free as part of the open source sponsorship program, we have to add a banner to the README and the site footer. This will help fulfill #7 .
Changes
Notes
base.html
template isn't extensible (I left it checked into the repo for posterity in case the datasette API is changed in the future).