diff --git a/Common/NSError+GBError.h b/Common/NSError+GBError.h index 59fb7a53..5d55401f 100644 --- a/Common/NSError+GBError.h +++ b/Common/NSError+GBError.h @@ -28,6 +28,7 @@ enum { GBErrorTemplatePathNotDirectory, GBErrorHTMLObjectTemplateMissing = 8000, + GBErrorHTMLDocumentTemplateMissing, GBErrorHTMLIndexTemplateMissing, GBErrorHTMLHierarchyTemplateMissing, diff --git a/Generating/GBHTMLOutputGenerator.m b/Generating/GBHTMLOutputGenerator.m index 15e676fb..21e529b6 100644 --- a/Generating/GBHTMLOutputGenerator.m +++ b/Generating/GBHTMLOutputGenerator.m @@ -171,6 +171,13 @@ - (BOOL)validateTemplates:(NSError **)error { } return NO; } + if (!self.htmlDocumentTemplate) { + if (error) { + NSString *desc = [NSString stringWithFormat:@"Document template file 'document-template.html' is missing at '%@'!", self.templateUserPath]; + *error = [NSError errorWithCode:GBErrorHTMLDocumentTemplateMissing description:desc reason:nil]; + } + return NO; + } if (!self.htmlIndexTemplate) { if (error) { NSString *desc = [NSString stringWithFormat:@"Index template file 'index-template.html' is missing at '%@'!", self.templateUserPath];