mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-05-12 11:21:35 +08:00
chore(docs): correctly link docs images
This commit is contained in:
@@ -45,7 +45,7 @@ function writeTheRest(writesFuture) {
|
|||||||
|
|
||||||
writesFuture.push(writer.symlinkTemplate('css'));
|
writesFuture.push(writer.symlinkTemplate('css'));
|
||||||
writesFuture.push(writer.symlinkTemplate('font'));
|
writesFuture.push(writer.symlinkTemplate('font'));
|
||||||
writesFuture.push(writer.symlinkTemplate('img'));
|
writesFuture.push(writer.symlink('../../docs/img', 'build/docs/img'));
|
||||||
writesFuture.push(writer.symlinkTemplate('js'));
|
writesFuture.push(writer.symlinkTemplate('js'));
|
||||||
|
|
||||||
var manifest = 'manifest="/build/docs/appcache.manifest"';
|
var manifest = 'manifest="/build/docs/appcache.manifest"';
|
||||||
|
|||||||
@@ -60,17 +60,23 @@ exports.copy = function(from, to, transform) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
exports.symlinkTemplate= symlinkTemplate;
|
exports.symlink = symlink;
|
||||||
|
function symlink(from, to) {
|
||||||
|
return qfs.exists(to).then(function(exists) {
|
||||||
|
if (!exists) {
|
||||||
|
return qfs.symbolicLink(to, from);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
exports.symlinkTemplate = symlinkTemplate;
|
||||||
function symlinkTemplate(filename) {
|
function symlinkTemplate(filename) {
|
||||||
var dest = OUTPUT_DIR + filename,
|
var dest = OUTPUT_DIR + filename,
|
||||||
dirDepth = dest.split('/').length,
|
dirDepth = dest.split('/').length,
|
||||||
src = Array(dirDepth).join('../') + 'docs/src/templates/' + filename;
|
src = Array(dirDepth).join('../') + 'docs/src/templates/' + filename;
|
||||||
|
|
||||||
return qfs.exists(dest).then(function(exists) {
|
return symlink(src, dest);
|
||||||
if (!exists) {
|
|
||||||
qfs.symbolicLink(dest, src);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user