Skip to content

Commit 1d42fda

Browse files
committed
Basic style changes: removing ul/li, using spans instead. styling ul/li @Sidebar
1 parent d2ba4e0 commit 1d42fda

File tree

2 files changed

+34
-25
lines changed

2 files changed

+34
-25
lines changed

javascripts/sidebar.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,30 @@ $(function() {
99

1010
// Render license/source information
1111
_(tutorials).each(function(tutorial){
12-
t = $(tutorial)
13-
d = t.data()
14-
attribution = ""
15-
if(d.authorGithub) {
16-
attribution += '<li>Author: <a href="http://github.com/' + d.authorGithub + '">' + d.authorGithub + '</a></li>'
17-
} else if(d.author) {
18-
attribution += "<li>Author: " + d.author + "</li>"
19-
}
20-
if(d.source) {
21-
attribution += '<li><a href="' + d.source + '">Original Source</a></li>'
12+
t = $(tutorial);
13+
d = t.data();
14+
var meta = d.authorGithub || d.author || d.source || d.license;
15+
if(meta) {
16+
var attribution = "";
17+
if(d.authorGithub) {
18+
attribution += '<span>by <a href="http://github.com/' + d.authorGithub + '">' + d.authorGithub + '</a></span>';
19+
} else if(d.author) {
20+
attribution += "<span>by " + d.author + "</span>"
21+
}
22+
if(d.source) {
23+
if (d.authorGithub || d.author) {
24+
attribution += '<span>|</span>';
25+
}
26+
attribution += '<span><a href="' + d.source + '">Original Source</a></span>';
27+
}
2228
if(d.license) {
23-
attribution += '<li><a href="' + d.license + '">License</a></li>'
29+
if (d.authorGithub || d.author || d.source) {
30+
attribution += '<span>|</span>';
31+
}
32+
attribution += '<span><a href="' + d.license + '">License</a></span>';
2433
}
34+
t.prepend("<p class='about'>" + attribution + "</p>");
2535
}
26-
if(attribution) { t.prepend("<ul>" + attribution + "</ul>")}
2736
});
2837

2938
dict = _.chain(tutorials)

stylesheets/styles.css

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ code, pre {
6565

6666
pre {
6767
padding:8px 15px;
68-
background: #f8f8f8;
68+
background: #f8f8f8;
6969
border-radius:5px;
7070
border:1px solid #e5e5e5;
7171
overflow-x: auto;
@@ -103,17 +103,17 @@ header {
103103
#download {
104104
list-style:none;
105105
height:40px;
106-
106+
107107
padding:0;
108-
108+
109109
background: #eee;
110110
background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%);
111111
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd));
112112
background: -webkit-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
113113
background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
114114
background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
115115
background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%);
116-
116+
117117
border-radius:5px;
118118
border:1px solid #d2d2d2;
119119
box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0;
@@ -186,33 +186,33 @@ footer {
186186
}
187187

188188
@media print, screen and (max-width: 960px) {
189-
189+
190190
div.wrapper {
191191
width:auto;
192192
margin:0;
193193
}
194-
194+
195195
header, section#main, footer {
196196
float:none;
197197
position:static;
198198
width:auto;
199199
}
200-
200+
201201
header {
202202
padding-right:320px;
203203
}
204-
204+
205205
section#main {
206206
border:1px solid #e5e5e5;
207207
border-width:1px 0;
208208
padding:20px 0;
209209
margin:0 0 20px;
210210
}
211-
211+
212212
header a small {
213213
display:inline;
214214
}
215-
215+
216216
#download {
217217
position:absolute;
218218
right:50px;
@@ -224,11 +224,11 @@ footer {
224224
body {
225225
word-wrap:break-word;
226226
}
227-
227+
228228
header {
229229
padding:0;
230230
}
231-
231+
232232
#download, header p.view {
233233
position:static;
234234
}
@@ -238,7 +238,7 @@ footer {
238238
body {
239239
padding:15px;
240240
}
241-
241+
242242
#download {
243243
display:none;
244244
}

0 commit comments

Comments
 (0)