-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlayout.clj
More file actions
180 lines (155 loc) · 10.1 KB
/
Copy pathlayout.clj
File metadata and controls
180 lines (155 loc) · 10.1 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
(ns cornwalltechjam.layout
(:require [hiccup.page :refer [html5]]
[optimus.link :as link]))
(def navigation-items
[{:title "Home", :path "/index.html"}
{:title "Photos from April", :path "/photos/20160409.html"}
{:title "Photos from March", :path "/photos/20160312.html"}
;; {:title "Finding us", :path "/locations/cornwall-college.html"}
;; {:title "Finding us", :path "/locations/bodmin-library.html"}
;; {:title "Finding us", :path "/locations/penwith-college.html"}
;; {:title "Finding us", :path "/locations/headforwards.html"}
{:title "Finding us", :path "/locations/fibrehub.html"}
;; {:title "Finding us", :path "/locations/pavilion.html"}
{:title "Online Resources", :path "/resources.html"}
{:title "Newsletter", :path "/newsletter.html"}
{:title "Future Jams", :path "/futurejams.html"}
;; {:title "Contact us", :path ".html"}
])
(defn- nav-props [item path]
(let [props {}]
(if (= path (:path item))
(assoc props :class "active")
props)))
(defn- navigation [path]
(map
(fn [item]
[:li (nav-props item path)
[:a {:href (:path item)} (:title item )]
])
navigation-items))
(defn- extra-javascript [javascript]
(if (= javascript "carousels")
[:script {:src "/assets/js/carousels.js"}]))
(defn layout-page-simple [request page]
(html5
[:head
[:meta {:charset "utf-8"}]
[:meta {:name "viewport"
:content "width=device-width, initial-scale=1.0"}]
[:title "Cornwall Tech Jam"]
[:link {:rel "stylesheet" :href (link/file-path request "/css/style.css")}]]
[:body
[:div.logo "cornwalltechjam.uk"]
[:div.body page]]))
(defn
layout-page-main [request {:keys [title description javascript path content]}]
(html5
[:head
[:meta {:charset "UTF-8"}]
[:meta {:name "viewport", :content "width=device-width, initial-scale=1"}]
[:meta {:name "viewport", :content "width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"}]
[:title {} title]
[:link {:rel "shortcut icon", :href "/assets/img/favicon.png"}]
[:meta {:name "description", :content description}]
[:link {:href "https://fonts.googleapis.com/css?family=Lato:100,300,400|Open+Sans:400italic,400,600|Muli:300|Indie+Flower:400|Oswald:400,700,300" :rel "stylesheet"}]
[:link {:href "/assets/css/bootstrap.min.css", :rel "stylesheet"}]
[:link {:href "/assets/css/bootstrap-switch.min.css", :rel "stylesheet"}]
[:link {:href "/assets/css/font-awesome.min.css", :rel "stylesheet"}]
[:link {:href "/assets/css/animate.min.css", :rel "stylesheet"}]
[:link {:href "/assets/css/slidebars.min.css", :rel "stylesheet"}]
;; [:link {:href "/assets/css/lightbox.css", :rel "stylesheet"}]
;; [:link {:href "/assets/css/jquery.bxslider.css", :rel "stylesheet"}]
[:link {:href "/assets/css/buttons.css", :rel "stylesheet"}]
[:link {:href "/assets/css/syntaxhighlighter/shCore.css", :rel "stylesheet"}]
[:link {:href "/assets/css/style-blue.css", :rel "stylesheet", :title "default"}]
[:link {:href "/assets/css/width-full.css", :rel "stylesheet", :title "default"}]
[:link {:href "/assets/css/techjam.css", :rel "stylesheet"}]
[:meta {:name "twitter:card", :content "summary"}]
[:meta {:name "twitter:site", :content "@cornwalltechjam"}]
[:meta {:name "twitter:title", :content title}]
[:meta {:name "twitter:description", :content description}]
[:meta {:name "twitter:image", :content "https://avatars1.githubusercontent.com/u/18351576"}]
"<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->" "\n " "<!--
[if lt IE 9]>\n <script src=\"/assets/js/html5shiv.min.js\"></script>\n <script src=\"/assets/js/respond.min.js\"></script>\n <!
[endif]-->" "\n"]
[:body {}
[:div {:id "sb-site"}
[:div {:class "boxed"}
[:header {:id "header-full-top", :class "hidden-xs header-full"}
[:div {:class "container"}
[:div {:class "header-full-title"}
[:h1 {:class "animated fadeInRight"}
[:a {:href "/index.html"} "Cornwall "
[:span {} "Tech Jam"]]]
[:p {:class "animated fadeInRight"} "Raspberry Pi's, Pasties and Programming"]]
[:nav {:class "top-nav"}
[:ul {:class "top-nav-social hidden-sm"}
[:li {}
[:a {:href "https://twitter.com/cornwalltechjam", :class "animated fadeIn animation-delay-7 twitter"}
[:i {:class "fa fa-twitter"}]]]
[:li {}
[:a {:href "https://www.facebook.com/cornwalltechjam", :class "animated fadeIn animation-delay-8 facebook"}
[:i {:class "fa fa-facebook"}]]]]
; [:li {}
; [:a {:href "https://www.meetup.com/Cornwall-Digital/events/269460728/", :class "animated fadeIn animation-delay-9 meetup"}
; [:img {:src "/assets/img/meetup-logo.svg"}]]]]
[:div {:class "dropdown animated fadeInDown animation-delay-11"}
[:a {:href "/index.html"}
[:i {:class "fa fa-bullhorn"}] " Next Tech Jam: 9th July"]]]]]
[:nav {:class "navbar navbar-default navbar-header-full navbar-dark yamm navbar-static-top", :role "navigation", :id "header"}
[:div {:class "container"}
"<!-- Brand and toggle get grouped for better mobile display -->"
[:div {:class "navbar-header"}
[:button {:type "button", :class "navbar-toggle", :data-toggle "collapse", :data-target "#bs-example-navbar-collapse-1"}
[:span {:class "sr-only"} "Toggle navigation"]
[:i {:class "fa fa-bars"}]]
[:a {:id "ar-brand", :class "navbar-brand hidden-lg hidden-md hidden-sm", :href "/index.html"} "Cornwall "
[:span {} "Tech Jam"]]]
[:div {:class "collapse navbar-collapse", :id "bs-example-navbar-collapse-1"}
[:ul {:class "nav navbar-nav"}
(navigation path)]]]]
content
[:aside {:id "footer-widgets"}
[:div {:class "container"}
[:div {:class "row"}
[:div {:class "col-md-4"}
[:div {:class "footer-widget"}
[:h3 {:class "footer-widget-title"} "Through the keyhole"]
[:div {:class "row"}
[:div {:class "col-lg-6 col-md-6 col-sm-3 col-xs-6"}
[:div.thumbnail [:img {:alt "The infamous Mission to Mars rover", :class "img-responsive", :src "/assets/img/footer/tj_mission_to_mars_rover.jpg"}]]]
[:div {:class "col-lg-6 col-md-6 col-sm-3 col-xs-6"}
[:div.thumbnail [:img {:alt "Close up of an ESP8266 module connect to a breadboard", :class "img-responsive", :src "/assets/img/footer/eot_esp_8266_close_up.jpg"}]]]
[:div {:class "col-lg-6 col-md-6 col-sm-3 col-xs-6"}
[:div.thumbnail [:img {:alt "Mike Trebilcock interfacing with the Cornish programmer's fuel of choice (a pasty)", :class "img-responsive", :src "/assets/img/footer/tj_mike_pasty.jpg"}]]]
[:div {:class "col-lg-6 col-md-6 col-sm-3 col-xs-6"}
[:div.thumbnail [:img {:alt "Hard at work soldering at the Eden of Things project", :class "img-responsive", :src "/assets/img/footer/eot_soldering.jpg"}]]]]]]
[:div {:class "col-md-4"}
[:div {:class "footer-widget footer-swcornwall"}
[:a {:href "http://www.softwarecornwall.org" :title "Proud to be part of Software Cornwall"}
[:img {:src "/assets/img/software_cornwall_logo_square.png" :alt "Software Cornwall logo"}]]]]
[:div {:class "col-md-4"}
[:div {:class "footer-widget footer-about"}
[:h3 {:class "footer-widget-title"} "A little bit about the Tech Jam"]
[:p "Cornwall's Tech Jams are run by volunteers working in IT and education throughout Cornwall, in association with Software Cornwall and local businesses."]
[:p "Except where otherwise noted, content on this site is licensed under a " [:a {:href "http://creativecommons.org/licenses/by/4.0/"} "Creative Commons Attribution 4.0 International license"] "."]
[:p "Powered by " [:a {:href "https://clojure.org/"} "Clojure"] " and " [:a {:href "https://github.com/magnars/stasis"} "Stasis"] ", created with " [:a {:href "https://www.gnu.org/software/emacs/"} "Emacs"] ", source code on " [:a {:href "https://github.com/CornwallTechJam"} "GitHub"] "."]
]]
]
" " "<!-- row -->" ]
" " "<!-- container -->" ]
[:footer {:id "footer"}
[:p "We're hosted on"]
[:a {:href "https://github.com/CornwallTechJam"} [:img {:src "/assets/img/github_pages.svg"}]]]]
[:div {:id "back-top"} [:a {:href "#header"} [:i {:class "fa fa-chevron-up"}]]]
;; "\n\n" "<!-- Scripts -->" "<!-- Compiled in vendors.js -->" "<!--\n<script src=\"/assets/js/jquery.min.js\"></script>\n<script src=\"/assets/js/jquery.cookie.js\"></script>\n<script src=\"/assets/js/imagesloaded.pkgd.min.js\"></script>\n<script src=\"/assets/js/bootstrap.min.js\"></script>\n<script src=\"/assets/js/bootstrap-switch.min.js\"></script>\n<script src=\"/assets/js/wow.min.js\"></script>\n<script src=\"/assets/js/slidebars.min.js\"></script>\n<script src=\"/assets/js/jquery.bxslider.min.js\"></script>\n<script src=\"/assets/js/holder.js\"></script>\n<script src=\"/assets/js/buttons.js\"></script>\n<script src=\"/assets/js/jquery.mixitup.min.js\"></script>\n<script src=\"/assets/js/circles.min.js\"></script>\n<script src=\"/assets/js/masonry.pkgd.min.js\"></script>\n<script src=\"/assets/js/jquery.matchHeight-min.js\"></script>\n-->" "\n\n"
[:script {:src "/assets/js/vendors.js"}]
;; "\n\n" "<!--<script type=\"text/javascript\" src=\"/assets/js/jquery.themepunch.tools.min.js?rev=5.0\"></script>\n<script type=\"text/javascript\" src=\"/assets/js/jquery.themepunch.revolution.min.js?rev=5.0\"></script>-->" "\n\n\n" "<!-- Syntaxhighlighter -->"
[:script {:src "/assets/js/syntaxhighlighter/shCore.js"}]
[:script {:src "/assets/js/syntaxhighlighter/shBrushXml.js"}]
[:script {:src "/assets/js/syntaxhighlighter/shBrushJScript.js"}]
"\n\n" [:script {:src "/assets/js/DropdownHover.js"}]
[:script {:src "/assets/js/app.js"}]
[:script {:src "/assets/js/holder.js"}]
(extra-javascript javascript)]]))