Load JS through Django's staticfiles app

This avoids the need for adjustments during development and allows production to
be served under a single /static declaration in Apache.
This commit is contained in:
Ben Sturmfels 2024-02-27 09:25:05 +11:00
parent 279f1deae5
commit caa0ff7b86
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
3 changed files with 18 additions and 16 deletions

View file

@ -1,9 +1,11 @@
{% extends "base_conservancy.html" %}
{% load static %}
{% block subtitle %}Support Conservancy - {% endblock %}
{% block category %}supporter{% endblock %}
{% block head %}
<script type="text/javascript" src="/js/supporter-page.js"></script>
<script type="text/javascript" src="{% static 'js/supporter-page.js' %}"></script>
<link href="/css/forms.css" rel="stylesheet" type="text/css"/>
{% endblock %}

View file

@ -15,8 +15,8 @@
<link rel="stylesheet" type="text/css" href="/css/tachyons.css"/>
<link rel="stylesheet" type="text/css" media="screen" href="/css/conservancy.css" />
<link rel="stylesheet" type="text/css" media="(min-width: 67em)" href="/css/conservancy-bigscreen.css" />
<script type="text/javascript" src="/js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="/js/conservancy.js"></script>
<script type="text/javascript" src="{% static 'js/jquery-1.7.2.js' %}"></script>
<script type="text/javascript" src="{% static 'js/conservancy.js' %}"></script>
{% block head %}{% endblock %}
</head>

View file

@ -4,7 +4,7 @@
{% block category %}sustainer{% endblock %}
{% block head %}
<script type="text/javascript" src="/js/supporter-page.js"></script>
<script type="text/javascript" src="{% static 'js/supporter-page.js' %}"></script>
<link href="/css/forms.css" rel="stylesheet" type="text/css"/>
{% include "opengraph_partial.html" with url="/sustainer/" title="Support Conservancy!" description="Software freedom is critical to many of today&rsquo;s most pressing social issues, but it&rsquo;s only effective when FOSS is for everyone. Support Conservancy today to help make that happen!" %}
{% include "opengraph_urllist_partial.html" with property='image' urls='' fallback='/img/conservancy-logo.png' %}