/
base.html
111 lines (89 loc) · 3.6 KB
/
base.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
101
102
103
104
105
106
107
108
109
110
111
{# Allows the DOCTYPE to be set on a page by page basis #}
{%- block doctype %}<!DOCTYPE html>{% endblock -%}
{# Allows custom attributes to be added to the <html> tag #}
{%- block htmltag -%}
{% set lang = h.lang() %}
<!--[if IE 7]> <html lang="{{ lang }}" class="ie ie7"> <![endif]-->
<!--[if IE 8]> <html lang="{{ lang }}" class="ie ie8"> <![endif]-->
<!--[if IE 9]> <html lang="{{ lang }}" class="ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="{{ lang }}"> <!--<![endif]-->
{%- endblock -%}
{# Allows custom attributes to be added to the <head> tag #}
<head{% block headtag %}{% endblock %}>
{# Append a .js class to the html element #}
<script>document.getElementsByTagName('html')[0].className += ' js';</script>
{#
Add custom meta tags to the page. Call super() to get the default tags
such as charset, viewport and generator.
Example:
{% block meta %}
{{ super() }}
<meta name="description" value="My website description" />
{% endblock %}
#}
{%- block meta -%}
<meta charset="utf-8" />
{%- endblock -%}
{#
Add a custom title to the page by extending the title block. Call super()
to get the default page title.
Example:
{% block title %}My Subtitle - {{ super() }}{% endblock %}
#}
<title>{% block title %}CKAN{% endblock %}</title>
{#
The html5shim allows you to modify/override the html5 shim. This is useful
for modifying it's behaviour or removing it completely.
#}
{%- block html5shim -%}
{# Temporary link until we get resource helper working #}
<!--[if lte IE 8]><script src="{% url_for_static '/base/javascript/vendor/html5.js' %}"></script><![endif]-->
{%- endblock -%}
{#
The links block allows you to add additonal content before the stylesheets
such as rss feeds and favicons in the same way as the meta block.
#}
{% block links -%}
<link rel="shortcut icon" href="{% url_for_static '/base/images/ckan.ico' %}" />
{% endblock -%}
{#
The styles block allows you to add additonal stylesheets to the page in
the same way as the meta block. Use super() to include the default
stylesheets before or after your own.
Example:
{% block styles %}
{{ super() }}
<link rel="stylesheet" href="/base/css/custom.css" />
{% endblock %}
#}
{%- block styles %}
<!--[if IE 7]> <link rel="stylesheet" href="{% url_for_static '/base/css/vendor/font-awesome-ie7.css' %}" /> <![endif]-->
<link rel="stylesheet" href="{% url_for_static ('/base/css/main.debug.css' if config.debug else '/base/css/main.css') %}" />
{% endblock %}
</head>
{# Allows custom attributes to be added to the <body> tag #}
<body{% block bodytag %} data-site-root="{{ h.url('/', locale='default', qualified=true) }}" data-locale-root="{{ h.url('/', qualified=true) }}"{% endblock %}>
{#
The page block allows you to add content to the page. Most of the time it is
recommended that you extend one of the page.html templates in order to get
the site header and footer. If you need a clean page then this is the
block to use.
Example:
{% block page %}
<div>Some other page content</div>
{% endblock %}
#}
{%- block page %}{% endblock -%}
{#
The scripts block allows you to add additonal scripts to the page. Use the
super() function to load the default scripts before/after your own.
Example:
{% block scripts %}
{{ super() }}
<script src="/base/js/custom.js"></script>
{% endblock %}
#}
{%- block scripts %}
{% endblock -%}
</body>
</html>