-
Notifications
You must be signed in to change notification settings - Fork 28
/
page.html
100 lines (80 loc) · 2.7 KB
/
page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{% load django_static %}
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Test page</title>
<link rel="stylesheet" href="{% slimfile "/css/styles.css" %}" type="text/css" media="all" />
{% slimall %}
<link rel="stylesheet" href='/css/reset.css' type="text/css" />
<link rel="stylesheet" href="/css/styles.css" type="text/css">
{% endslimall %}
<style type="text/css">
{% slimcontent "css" %}
h1, h2, h3 {
font-face:'Trebuchet MS', Verdana, Arial;
}
{% endslimcontent %}
</style>
</head>
<body>
<div id="content">
<h1>Test page</h1>
<a href="http://www.peterbe.com/">
<img src="{% staticfile "/images/peterbe.jpg" %}" class="peter" alt="Proud author Peterbe" border="0" />
</a>
{% include "showicons.html" %}
{% staticall %}
<p>Some images<br/>
<img src="/images/icon1.png"/>
<img alt="Uh?" src="/images/icon2.png"/>
<img
src="/images/icon3.png"
/>
<img src="/images/deliberately_non_existant.png"/>
</p>
{% endstaticall %}
{% slimcontent %}
<h3>Benefits of django-static</h3>
<ul>
<li>
<a href="http://pypi.python.org/pypi/slimmer/">Uses slimmer</a>
</li>
<li>Full control over your static serving</li>
<li>Rewrites urls in .css files for static serving</li>
<li>Uses symbolic links to make it easy to set up aggressive caching in fronting web server (e.g. nginx)</li>
</ul>
{% endslimcontent %}
<h4>Stricken through</h4>
<h4 class="sub">Italic text</h4>
</div>
<script type="text/javascript" src="{% staticfile "/javascript/jquery-1.3.2.min.js" %}"></script>
<script type="text/javascript" src="{% slimfile "/javascript/script.js" %}"></script>
<script type="text/javascript">
{% slimcontent "js" %}
/* Example of inline Javascript */
var a = "A";
var adder = function add(a, b) {
// pointless but proves the point
return a + b;
}
{% endslimcontent %}
{% slimcontent %}
// This time it can guess it's javascript
function add(one, two) {
if (one == two) {
return one * two;
} else {
return one + two;
}
}
{% endslimcontent %}
</script>
<script src="{% slimfile "/javascript/shit_code.js" %}"></script>
{% slimall %}
<script src="/javascript/canbe.js"></script>
<script src="/javascript/combined.min.js"></script>
{% endslimall %}
</body>
</html>