Permalink
Browse files

Metadata parsing modifications.

  • Loading branch information...
1 parent 501e2df commit e2727d0b8a3b47f7ef0f5e2dc96084b1090fed3a Michael Aufreiter committed Jul 13, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 _includes/model.js
View
@@ -153,7 +153,7 @@ function loadPosts(user, repo, branch, path, cb) {
var repo = getRepo(user, repo);
function getDefaultBranch(cb) {
- repo.show(function(err, repo) {
+ repo.show(function(err, repo) {
cb(null, repo.master_branch);
});
}
@@ -228,7 +228,7 @@ function loadPosts(user, repo, branch, path, cb) {
// List all postings for a given repository
// Looks into _posts/blog
-function saveFile(user, repo, branch, path, metadata, content, message, cb) {
+function saveFile(user, repo, branch, path, metadata, content, message, cb) {
var repo = getRepo(user, repo);
function serialize() {
@@ -245,7 +245,7 @@ function saveFile(user, repo, branch, path, metadata, content, message, cb) {
// Delete Post
// -------
-function deletePost(user, repo, branch, path, file, cb) {
+function deletePost(user, repo, branch, path, file, cb) {
var repo = getRepo(user, repo);
repo.remove(branch, _.filepath(path, file), cb);
}
@@ -254,12 +254,13 @@ function deletePost(user, repo, branch, path, file, cb) {
// Move Post
// -------
-function movePost(user, repo, branch, path, newPath, cb) {
+function movePost(user, repo, branch, path, newPath, cb) {
var repo = getRepo(user, repo);
repo.move(branch, path, newPath, cb);
}
+
// New Post
// -------
//
@@ -275,9 +276,9 @@ function emptyPost(user, repo, branch, path, cb) {
var cfg = app.state.config
if (cfg && cfg.prose && cfg.prose.metadata) {
if (cfg.prose.metadata[path]) {
- metadata = cfg.prose.metadata[path];
+ rawMetadata = cfg.prose.metadata[path];
try {
- rawMetadata = YAML.encode(metadata);
+ metadata = jsyaml.load(rawMetadata);
} catch(err) {
console.log('ERROR encoding YAML');
// No-op

0 comments on commit e2727d0

Please sign in to comment.