mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Handle correctly ignored file in multilanguages book
This commit is contained in:
@@ -121,6 +121,14 @@ Book.prototype.getContentRoot = function() {
|
||||
*/
|
||||
Book.prototype.isFileIgnored = function(filename) {
|
||||
var ignore = this.getIgnore();
|
||||
var language = this.getLanguage();
|
||||
|
||||
// Ignore is always relative to the root of the main book
|
||||
if (language) {
|
||||
filename = path.join(language, filename);
|
||||
}
|
||||
|
||||
|
||||
return ignore.filter([filename]).length == 0;
|
||||
};
|
||||
|
||||
@@ -217,6 +225,7 @@ Book.createForFS = function createForFS(fs) {
|
||||
Book.createFromParent = function createFromParent(parent, language) {
|
||||
return new Book({
|
||||
logger: parent.getLogger(),
|
||||
ignore: parent.getIgnore(),
|
||||
language: language,
|
||||
fs: FS.reduceScope(parent.getFS(), language)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user