Furthering the renaming from generate to build

This commit is contained in:
Andrew Davidson 2016-01-23 18:44:45 -05:00
parent a0e5589323
commit 074dcd4a31
4 changed files with 12 additions and 12 deletions

View file

@ -121,7 +121,7 @@ Post.prototype.getFilePath = function () {
// Arguments: None
// Returns: Directory path as String
Post.prototype.getDirectory = function () {
var dir = path.join(config.genDir,this.getURL());
var dir = path.join(config.buildDir,this.getURL());
return dir;
}
@ -151,9 +151,9 @@ Post.prototype.makeSlug = function () {
// Function to build static renderings of a particular post.
// Arguments: Callback function
// Returns: err
Post.prototype.buildPost = function (callback) {
Post.prototype.build = function (callback) {
var options = {
pretty: false,
pretty: true,
post: this
};

View file

@ -158,7 +158,7 @@ module.exports = function(app) {
post = Post.getByUUID(req.params.uuid, function (err, post) {
console.log("Got post: "+post.get("title"));
if (err) console.log(err);
post.buildPost(function (err) {
post.build(function (err) {
if (!err) {
req.flash('successNotice', 'Post rebuilt successfully.');
res.redirect(req.header('Referer') || '/admin');

View file

@ -8,7 +8,7 @@ module.exports = function (app) {
require('connect-ensure-login').ensureLoggedIn(),
function(req, res, next) {
if (req.params[0] != '') {
var path = __dirname + '/' + config.genDir + '/blog/' + req.params[0];
var path = __dirname + '/' + config.buildDir + '/blog/' + req.params[0];
console.log('Trying to serve: ' + path);
fs.exists(path, function(exists) {
if (exists) {
@ -36,7 +36,7 @@ module.exports = function (app) {
require('connect-ensure-login').ensureLoggedIn(),
function(req, res, next) {
if (req.params[0] != '') {
var path = __dirname + '/' + config.genDir + '/photos/' + req.params[0];
var path = __dirname + '/' + config.buildDir + '/photos/' + req.params[0];
console.log('Trying to serve: ' + path);
fs.exists(path, function(exists) {
if (exists) {
@ -64,7 +64,7 @@ module.exports = function (app) {
require('connect-ensure-login').ensureLoggedIn(),
function(req, res, next) {
if (req.params[0] != '') {
var path = __dirname + '/' + config.genDir + '/galleries/' + req.params[0];
var path = __dirname + '/' + config.buildDir + '/galleries/' + req.params[0];
console.log('Trying to serve: ' + path);
fs.exists(path, function(exists) {
if (exists) {
@ -92,7 +92,7 @@ module.exports = function (app) {
require('connect-ensure-login').ensureLoggedIn(),
function(req, res, next) {
if (req.params[0] != '') {
var path = __dirname + '/' + config.genDir + '/static/' + req.params[0];
var path = __dirname + '/' + config.buildDir + '/static/' + req.params[0];
console.log('Trying to serve: ' + path);
fs.exists(path, function(exists) {
if (exists) {

View file

@ -17,9 +17,9 @@ block content
td #{photo.dateString}
td
a(href="/admin/photo/edit/#{photo.id}") Edit
| -
| -
a(href="/admin/photo/delete/#{photo.id}") Delete
| -
a(href="/admin/photo/regenerate/#{photo.id}") Regenerate
| -
| -
a(href="/admin/photo/rebuild/#{photo.id}") Rebuild
| -
a(href="/admin/photo/publish/#{photo.id}") Publish