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

Commit

Permalink
chore(docs): correctly link docs images
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed Aug 30, 2012
1 parent e0184d4 commit 8693eac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/src/gen-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function writeTheRest(writesFuture) {

writesFuture.push(writer.symlinkTemplate('css'));
writesFuture.push(writer.symlinkTemplate('font'));
writesFuture.push(writer.symlinkTemplate('img'));
writesFuture.push(writer.symlink('../../docs/img', 'build/docs/img'));
writesFuture.push(writer.symlinkTemplate('js'));

var manifest = 'manifest="/build/docs/appcache.manifest"';
Expand Down
18 changes: 12 additions & 6 deletions docs/src/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
var dest = OUTPUT_DIR + filename,
dirDepth = dest.split('/').length,
src = Array(dirDepth).join('../') + 'docs/src/templates/' + filename;

return qfs.exists(dest).then(function(exists) {
if (!exists) {
qfs.symbolicLink(dest, src);
}
});
return symlink(src, dest);
}


Expand Down

0 comments on commit 8693eac

Please sign in to comment.