tpl: Handle truncated identifiers in Go template errors
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 24 Oct 2018 11:32:46 +0000 (13:32 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 24 Oct 2018 11:54:04 +0000 (13:54 +0200)
commit2d7709d15584e4c11138cd7fe92717a2a58e4585
treed033ec9bae00cd07629344930235c666f7478081
parentdeff9e154bc0371af56741ddb22cb1f9e392838a
tpl: Handle truncated identifiers in Go template errors

Long identifiers will give errors on the format:

```bash
 _default/single.html:5:14: executing "main" at <.ThisIsAVeryLongTitl...>: can't evaluate field ThisIsAVeryLongTitle
```

Hugo use this value to match the "base template or not", so we need to strip the "...".

Fixes #5346
hugolib/hugo_sites_build_errors_test.go
tpl/template.go