Permalink
Browse files

Use repo.contents instead of repose.read to eliminate extra ajax request

  • Loading branch information...
1 parent dde5398 commit db89033e4ff403d0e56135385e2b728ce873e5e7 @dhcole dhcole committed Apr 4, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 _includes/model.js
View
@@ -223,7 +223,7 @@ function loadPosts(user, reponame, branch, path, cb) {
var repo = getRepo(user, reponame);
function loadConfig(cb) {
- repo.read(branch, "_config.yml", function(err, data) {
+ repo.contents(branch, "_config.yml", function(err, data) {
if (err) return cb(err);
cb(null, jsyaml.load(data));
});
@@ -420,7 +420,7 @@ function emptyPost(user, repo, branch, path, cb) {
function loadPost(user, repo, branch, path, file, cb) {
var repo = getRepo(user, repo);
- repo.read(branch, path ? path + "/" + file : file, function(err, data, commit) {
+ repo.contents(branch, path ? path + "/" + file : file, function(err, data, commit) {
if (err) return cb(err);
// Given a YAML front matter, determines published or not

0 comments on commit db89033

Please sign in to comment.