-
Notifications
You must be signed in to change notification settings - Fork 5
/
base.html.twig
160 lines (139 loc) · 7.54 KB
/
base.html.twig
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
{% set arrayofpath = uri.path|split('/') %}
{% set firstfolderofpath = arrayofpath[1] %}
{% set secondfolderofpath = arrayofpath[2] %}
{# MultiCourse hub compatibility - hibbittsdesign.org #}
{% if page.find('/' ~ firstfolderofpath).template == 'course' or page.find('/' ~ firstfolderofpath).template == 'subsite' %}
{% if firstfolderofpath %}
{% set favicon = page.find('/' ~ firstfolderofpath ~ '/favicon' ).media.images|first %}
{% set site_title = page.find('/' ~ firstfolderofpath ).title %}
{% else %}
{% set site_title = site.title|e('html') %}
{% endif %}
{% set footer_content = page.find('/' ~ firstfolderofpath ~ '/footer').content %}
{% if footer_content == empty %}
{% set footer_content = page.find('/footer').content %}
{% endif %}
{% elseif page.find('/' ~ firstfolderofpath ~ '/' ~ secondfolderofpath).template == 'course' or page.find('/' ~ firstfolderofpath ~ '/' ~ secondfolderofpath).template == 'subsite' %}
{% set favicon = page.find('/' ~ firstfolderofpath ~ '/' ~ secondfolderofpath ~ '/favicon' ).media.images|first %}
{% if favicon is empty %}
{% set favicon = page.find('/' ~ firstfolderofpath ~ '/favicon' ).media.images|first %}
{% endif %}
{% set site_title = page.find('/' ~ firstfolderofpath ~ '/' ~ secondfolderofpath).header.course_site_title %}
{% if site_title is empty %}
{% set site_title = page.find('/' ~ firstfolderofpath ~ '/' ~ secondfolderofpath).header.subsite_site_title %}
{% endif %}
{% if site_title is empty %}
{% set site_title = page.find('/' ~ firstfolderofpath ~ '/' ~ secondfolderofpath).title %}
{% endif %}
{% set footer_content = page.find('/' ~ firstfolderofpath ~ '/' ~ secondfolderofpath ~ '/footer').content %}
{% if footer_content == empty %}
{% set footer_content = page.find('/footer').content %}
{% endif %}
{% else %}
{% set favicon = page.find('/favicon' ).media.images|first %}
{% set site_title = site.title|e('html') %}
{% set footer_content = page.find('/footer').content %}
{% endif %}
{% if favicon == empty %}
{% set favicon = page.find('/favicon' ).media.images|first %}
{% if favicon == empty %}
{% set favicon_url = 'theme://images/favicon.png' %}
{% else %}
{% set favicon_url = favicon.url %}
{% endif %}
{% else %}
{% set favicon_url = favicon.url %}
{% endif %}
<!DOCTYPE html>
<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
<head>
{% block head %}
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{% include 'partials/metadata.html.twig' %}
<title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site_title }}</title>
<link rel="icon" type="image/png" href="{{ url(favicon_url,true) }}" />
{% block stylesheets %}
{# load theme.css and custom.css files - hibbittsdesign.org #}
{% if theme.theme_stylesheet is defined and theme_var('theme_stylesheet') is not empty %}
{% if theme_var('theme_stylesheet') != 'default' %}
{% do assets.addCss("theme://css/bootswatch/#{ theme_var('theme_stylesheet') }/bootstrap.min.css", 100) %}
{% else %}
{% do assets.addCss('theme://css/bootstrap/bootstrap.min.css') %}
{% endif %}
{% else %}
{% do assets.addCss('theme://css/bootstrap/bootstrap.min.css') %}
{% endif %}
{% do assets.add('theme://css/font-awesome.min.css') %}
{% do assets.add('theme://css-compiled/theme.css') %}
{% do assets.addCss('theme://css/theme.css') %}
{% do assets.addCss('theme://css/custom.css') %}
{% if ((grav.uri.param('chromeless') or grav.uri.param('embedded') or grav.uri.param('standalone')) or theme_var('chromeless.enabled')) %}
{% do assets.addInlineCss('.chromeless-show{display:block}.chromeless-hide{display:none}') %}
{% endif %}
{% endblock %}
{% block javascripts %}
{% do assets.add('jquery', 102) %}
{% do assets.add('theme://js/bootstrap.min.js', 101) %}
{% do assets.add('theme://js/modernizr-custom.js', 100) %}
{% do assets.add('theme://js/site.js', {group:'bottom'}) %}
{# load custom js - hibbittsdesign.org #}
{% do assets.addJs('theme://js/my.js', 99) %}
{% if browser.getBrowser == 'msie' and browser.getVersion >= 8 and browser.getVersion <= 9 %}
{% do assets.add('https://oss.maxcdn.com/respond/1.4.2/respond.min.js') %}
{% do assets.add('theme://js/html5shiv-printshiv.min.js') %}
{% endif %}
{% endblock %}
{% block assets deferred %}
{{ assets.css()|raw }}
{{ assets.js()|raw }}
{% endblock %}
{% endblock head %}
</head>
<body class="{% block body_classes %}{{ page.header.body_classes }}{% if (grav.uri.param('chromeless') or grav.uri.param('embedded') or grav.uri.param('standalone')) or (theme_var('chromeless.enabled')) %} chromeless{% endif %}{% endblock %}">
{# check content display flag - hibbittsdesign.org #}
{% if not (grav.uri.param('chromeless') or grav.uri.param('embedded') or grav.uri.param('standalone')) and not(theme_var('chromeless.enabled')) %}
{% if config.plugins.langswitcher.enabled %}
{% include 'partials/langswitcher.html.twig' %}
{% endif %}
{% block header_navigation %}
{% include 'partials/navigation.html.twig' %}
{% endblock %}
{% endif %}
{% block content %}{% endblock %}
{% block pagination %}{% endblock %}
{% if not (grav.uri.param('chromeless') or grav.uri.param('embedded') or grav.uri.param('standalone')) and not(theme_var('chromeless.enabled')) %}
<div class="footer">
<div class="container">
{% if page.find('/footer').header.footer_scroll %}
{# added top of page navigation element - hibbittsdesign.org #}
<div class="up-arrow">
<a href="#" id="top" title="Top of Page">
<i class="fa fa-angle-up" aria-hidden="true"></i>
</a>
</div>
{% endif %}
{# use footer folder page for content - hibbittsdesign.org #}
<div class="text-muted">
{% if (page.header.git_sync_repo_link_display is defined and page.header.git_sync_repo_link_display == 'footer' ) or (( theme_var('display_of_git_sync_repo_link') == 'footer' and page.header.git_sync_repo_link_display is not defined ) and not (page.header.hide_git_sync_repo_link)) %}
<p>{% include 'partials/git_sync_repo_link.html.twig' %}</p>
{% endif %}
{% if theme_var('git_sync_edit_theme_link_location') == 'footer' %}
<p>{% include 'partials/git_sync_theme_link.html.twig' %}</p>
{% endif %}
{% if footer_content %}
{{ footer_content|raw }}
{% endif %}
</div>
</div>
</div>
{% endif %}
<script async charset="utf-8" src="//cdn.embedly.com/widgets/platform.js"></script>
{% block bottom %}
{{ assets.js('bottom')|raw }}
{% endblock %}
{# added global scripts - hibbittsdesign.org #}
{% include 'partials/scripts.html.twig' %}
</body>
</html>