make listing/not listing of forks configurable

some people have more or less taken over projects with their forks, so
it probably makes sense to still list them among the repositories
This commit is contained in:
Philip Hofstetter 2011-08-04 21:24:48 +02:00
parent 2e1f0c0bfc
commit 16bb7729ec
2 changed files with 4 additions and 2 deletions

View File

@ -20,6 +20,7 @@
github.showRepos({ github.showRepos({
user: '{{site.github_user}}', user: '{{site.github_user}}',
count: {{site.github_repo_count}}, count: {{site.github_repo_count}},
skip_forks: {{site.github_skip_forks}},
target: '#gh_repos' target: '#gh_repos'
}); });
}); });

View File

@ -18,7 +18,8 @@ github = (function(){
var repos = []; var repos = [];
var i; var i;
for (i = 0; i < data.repositories.length; i++){ for (i = 0; i < data.repositories.length; i++){
if (!data.repositories[i].fork) if (options.skip_forks && !data.repositories[i].fork)
continue;
repos.push(data.repositories[i]); repos.push(data.repositories[i]);
} }
repos.sort(function(a, b){ repos.sort(function(a, b){