Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.

Commit

Permalink
Homepage: Use Handlebars helper to separate download links, fixes #347
Browse files Browse the repository at this point in the history
  • Loading branch information
fhemberger committed May 25, 2015
1 parent f740a57 commit cce6895
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
9 changes: 8 additions & 1 deletion gulp/util/content.js
Expand Up @@ -55,7 +55,14 @@ function generateContentAndTemplates() {
var hbsTemplates = {}; /* 5 */
var LocalHandlebars = Handlebars.create() /* 6 */

LocalHandlebars.registerPartial('current_download_links', `{{#project.current_version_downloads}}<a href="{{url}}">{{i18n "downloads" key}}</a>{{/project.current_version_downloads}}`)
LocalHandlebars.registerHelper('divider', function(context, index) {

if (index === context.length - 1) { return; }
if (index === context.length - 2) { return " & "; }
return ", ";
});

LocalHandlebars.registerPartial('current_download_links', `{{#project.current_version_downloads}}<a href="{{url}}">{{i18n "downloads" key}}</a>{{divider ../project.current_version_downloads @index}}{{/project.current_version_downloads}}`)

LocalHandlebars.registerHelper('i18n', function() {
var env, key;
Expand Down
10 changes: 0 additions & 10 deletions source/styles/home.styl
Expand Up @@ -40,16 +40,6 @@
padding-bottom 0
margin-right 10px

a:after
content ', '

a:nth-last-child(2):after
content ' & '
color rgba(0, 0, 0, 0.5)

a:last-child:after
content ''

.home-secondary-links
margin-top 40px
p
Expand Down

0 comments on commit cce6895

Please sign in to comment.