Skip to content

Commit fa80730

Browse files
committed
Improved the page template a bit.
1 parent a0e06ee commit fa80730

File tree

2 files changed

+61
-15
lines changed

2 files changed

+61
-15
lines changed

src/template.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var fs = require( "fs" ),
66
Handlebars.registerHelper( "dependencyList", function() {
77
var dependencies = this.dependencies;
88
return new Handlebars.SafeString( "<ul>" + Object.keys( dependencies ).map(function( dependency ) {
9-
return "<li>" + dependency + ": " + dependencies[ dependency ] + "</li>";
9+
return "<li><a href=/" + dependency + "><b>" + dependency + "</b></a> (" + dependencies[ dependency ] + ")</li>";
1010
}) + "</ul>" );
1111
});
1212

@@ -18,8 +18,8 @@ Handlebars.registerHelper( "allContributors", function() {
1818

1919
Handlebars.registerHelper( "licenses", function() {
2020
return new Handlebars.SafeString( this.licenses.map(function( license ) {
21-
return "<a href='" + license.url + "'>" + license.type + "</a>";
22-
}).join( ", " ));
21+
return "<a href='" + license.url + "'><b>" + license.type + "</b></a>";
22+
}).join( " or " ));
2323
});
2424

2525
Handlebars.registerHelper( "person", function( person ) {

template/page

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,61 @@
1-
<p>{{description}}</p>
2-
<div>
3-
<div>
4-
<a href="{{_downloadUrl}}">Download {{title}}<br>Version {{version}}</a>
5-
Requires: {{dependencyList}}
1+
<div class="col col3-2">
2+
<h1>{{title}}</h1>
3+
<p><b>{{name}}</b> by {{person author}}</p>
4+
<div class="block">
5+
<p>{{description}}</p>
66
</div>
7-
<div>
8-
Homepage: {{homepage}}<br>
9-
Author: {{person author}}<br>
10-
{{#if contributors}}
11-
Contributors: {{allContributors}}<br>
12-
{{/if}}
13-
License: {{licenses}}
7+
<div class="block">
8+
<h2>Author</h2>
9+
{{person author}}
1410
</div>
11+
{{#if contributors}}
12+
<div class="block">
13+
<h2>Contributors</h2>
14+
{{allContributors}}
15+
</div>
16+
{{/if}}
17+
</div>
18+
<div class="col col3-1">
19+
<div class="block">
20+
<h2>Get it now</h2>
21+
<ul>
22+
<li><a href="{{_downloadUrl}}"><b>Download</b> plugin</a></li>
23+
<li><a href="{{url}}"><b>Fork</b> on GitHub</a></li>
24+
<li><a href="{{homepage}}"><b>View</b> homepage</a></li>
25+
</ul>
26+
</div>
27+
<div class="block clearfix">
28+
<div class="col col4-2">
29+
<h2>Watchers</h2>
30+
<b>?</b>
31+
</div>
32+
<div class="col col4-2 right">
33+
<h2>Forks</h2>
34+
<b>?</b>
35+
</div>
36+
</div>
37+
<div class="block clearfix">
38+
<div class="col col4-2">
39+
<h2>Version</h2>
40+
<b>{{version}}</b>
41+
</div>
42+
<div class="col col4-2 right">
43+
<h2>Released</h2>
44+
<b>?</b>
45+
</div>
46+
</div>
47+
<div class="block">
48+
<h2>License</h2>
49+
{{licenses}}
50+
</div>
51+
<div class="block">
52+
<h2>Dependencies</h2>
53+
{{dependencyList}}
54+
</div>
55+
<div class="block">
56+
<h2>Tags</h2>
57+
<ul>
58+
<li>?</li>
59+
</ul>
60+
</div>
1561
</div>

0 commit comments

Comments
 (0)