Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 8693eac

Browse files
committed
chore(docs): correctly link docs images
1 parent e0184d4 commit 8693eac

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

docs/src/gen-docs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function writeTheRest(writesFuture) {
4545

4646
writesFuture.push(writer.symlinkTemplate('css'));
4747
writesFuture.push(writer.symlinkTemplate('font'));
48-
writesFuture.push(writer.symlinkTemplate('img'));
48+
writesFuture.push(writer.symlink('../../docs/img', 'build/docs/img'));
4949
writesFuture.push(writer.symlinkTemplate('js'));
5050

5151
var manifest = 'manifest="/build/docs/appcache.manifest"';

docs/src/writer.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,23 @@ exports.copy = function(from, to, transform) {
6060
};
6161

6262

63-
exports.symlinkTemplate= symlinkTemplate;
63+
exports.symlink = symlink;
64+
function symlink(from, to) {
65+
return qfs.exists(to).then(function(exists) {
66+
if (!exists) {
67+
return qfs.symbolicLink(to, from);
68+
}
69+
});
70+
}
71+
72+
73+
exports.symlinkTemplate = symlinkTemplate;
6474
function symlinkTemplate(filename) {
6575
var dest = OUTPUT_DIR + filename,
6676
dirDepth = dest.split('/').length,
6777
src = Array(dirDepth).join('../') + 'docs/src/templates/' + filename;
6878

69-
return qfs.exists(dest).then(function(exists) {
70-
if (!exists) {
71-
qfs.symbolicLink(dest, src);
72-
}
73-
});
79+
return symlink(src, dest);
7480
}
7581

7682

0 commit comments

Comments
 (0)