},
},
+ {
+ name: "Single template execute failed, long keyword",
+ fileType: single,
+ fileFixer: func(content string) string {
+ return strings.Replace(content, ".Title", ".ThisIsAVeryLongTitle", 1)
+ },
+ assertBuildError: func(a testSiteBuildErrorAsserter, err error) {
+ fe := a.getFileError(err)
+ assert.Equal(5, fe.LineNumber)
+ assert.Equal(14, fe.ColumnNumber)
+ assert.Equal("go-html-template", fe.ChromaLexer)
+ a.assertErrorMessage("\"layouts/_default/single.html:5:14\": execute of template failed", fe.Error())
+
+ },
+ },
{
name: "Shortcode parse failed",
fileType: shortcode,
return
}
-var identifiersRe = regexp.MustCompile("at \\<(.*?)\\>:")
+// The identifiers may be truncated in the log, e.g.
+// "executing "main" at <$scaled.SRelPermalin...>: can't evaluate field SRelPermalink in type *resource.Image"
+var identifiersRe = regexp.MustCompile("at \\<(.*?)(\\.{3})?\\>:")
func (t *TemplateAdapter) extractIdentifiers(line string) []string {
m := identifiersRe.FindAllStringSubmatch(line, -1)