Refactored alternate_url_json mechanism, refs #1620, #1533

This commit is contained in:
Simon Willison 2022-02-02 13:32:47 -08:00
commit 8d5779acf0
10 changed files with 27 additions and 62 deletions

View file

@ -10,6 +10,9 @@
{% for url in extra_js_urls %}
<script {% if url.module %}type="module" {% endif %}src="{{ url.url }}"{% if url.sri %} integrity="{{ url.sri }}" crossorigin="anonymous"{% endif %}></script>
{% endfor %}
{%- if alternate_url_json -%}
<link rel="alternate" type="application/json+datasette" href="{{ alternate_url_json }}">
{%- endif -%}
{%- block extra_head %}{% endblock -%}
</head>
<body class="{% block body_class %}{% endblock %}">

View file

@ -4,7 +4,6 @@
{% block extra_head %}
{{- super() -}}
<link rel="alternate" type="application/json+datasette" href="{{ alternate_url_json }}">
{% include "_codemirror.html" %}
{% endblock %}

View file

@ -4,7 +4,6 @@
{% block extra_head %}
{{- super() -}}
<link rel="alternate" type="application/json+datasette" href="{{ alternate_url_json }}">
{% if columns %}
<style>
@media only screen and (max-width: 576px) {

View file

@ -4,7 +4,6 @@
{% block extra_head %}
{{- super() -}}
<link rel="alternate" type="application/json+datasette" href="{{ alternate_url_json }}">
<style>
@media only screen and (max-width: 576px) {
{% for column in columns %}

View file

@ -4,7 +4,6 @@
{% block extra_head %}
{{- super() -}}
<link rel="alternate" type="application/json+datasette" href="{{ alternate_url_json }}">
<script src="{{ urls.static('table.js') }}" defer></script>
<style>
@media only screen and (max-width: 576px) {