home / docs / sections_fts

Menu

sections_fts: 40

This data as json

rowid title content
40 .static(path, plugin=None, mount=None) path - string The path to the static asset, relative to the selected static directory. plugin - string, optional The plugin name, for linking to an asset in that plugin's static/ directory. mount - string, optional The --static mount name, for linking to an asset in a directory mounted using datasette --static mount_name:directory . Returns a URL for a static asset with a ?_hash= parameter based on the file contents. That URL takes the base_url setting into account. When the ?_hash= parameter matches the current file contents, Datasette will serve the asset with Cache-Control: max-age=31536000, immutable, public . Call this with just path for one of Datasette's bundled static assets: datasette.static("app.css") Use plugin= for plugin static assets: datasette.static( "plugin.js", plugin="datasette_plugin_name" ) Use mount= for static directories mounted using the --static option: datasette.static("styles.css", mount="assets") plugin and mount are mutually exclusive. The same feature is available to Jinja templates as the static() template function, described in Linking to static assets .
Powered by Datasette · Queries took 3.828ms