mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 03:14:03 +03:00
parent
9b2434be4c
commit
48d3b10649
@ -48,14 +48,12 @@ localfilesystem = {
|
||||
month = m.format('MMM'),
|
||||
year = m.format('YYYY'),
|
||||
target_dir = path.join('content/images', year, month),
|
||||
target_path = path.join(target_dir, image.name),
|
||||
ext = path.extname(image.name),
|
||||
basename = path.basename(image.name, ext).replace(/[\W]/gi, '_');
|
||||
|
||||
getUniqueFileName(target_dir, basename, ext, null, function (filename) {
|
||||
|
||||
nodefn.call(fs.mkdirs, target_dir).then(function () {
|
||||
return nodefn.call(fs.copy, image.path, target_path);
|
||||
return nodefn.call(fs.copy, image.path, filename);
|
||||
}).then(function () {
|
||||
// The src for the image must be in URI format, not a file system path, which in Windows uses \
|
||||
// For local file system storage can use relative path so add a slash
|
||||
|
@ -36,7 +36,7 @@
|
||||
"downsize": "0.0.3",
|
||||
"express": "3.4.4",
|
||||
"express-hbs": "0.5.1",
|
||||
"fs-extra": "0.6.3",
|
||||
"fs-extra": "0.8.1",
|
||||
"knex": "0.4.13",
|
||||
"moment": "2.4.0",
|
||||
"node-polyglot": "0.3.0",
|
||||
|
Loading…
Reference in New Issue
Block a user