Error: Can't evaluate field ReadingTime in type hugolib.PageMeta

I started receiving the following error as I recently updated Hugo to master.

Started building sites ...
ERROR: 2016/09/28 09:06:26 template.go:132: template: writing/summary.html:5:156: executing "writing/summary.html" at <.PageMeta.ReadingTim...>: can't evaluate field ReadingTime in type hugolib.PageMeta in writing/summary.html
ERROR: 2016/09/28 09:06:26 template.go:132: template: writing/summary.html:5:156: executing "writing/summary.html" at <.PageMeta.ReadingTim...>: can't evaluate field ReadingTime in type hugolib.PageMeta in writing/summary.html
ERROR: 2016/09/28 09:06:26 general.go:212: Error while rendering page writing/artistic-style-transfer.md: template: writing/single.html:20:156: executing "writing/single.html" at <.PageMeta.ReadingTim...>: can't evaluate field ReadingTime in type hugolib.PageMeta
make: *** [all] Error 255

The offending layout files are here: https://github.com/hnarayanan/harishnarayanan.org/tree/master/layout/writing

And the offending piece of content is here: https://github.com/hnarayanan/harishnarayanan.org/blob/master/content/writing/artistic-style-transfer.md

Has anyone seen this before? Could there be something weird about my content that’s preventing Hugo from estimating a ReadingTime? Furthermore, does anyone have an idea what changed recently to cause this different behaviour?

If no one has any ideas, I’ll break out git bisect and have a go at investigating. :slight_smile:

It is my fault. I didn’t think about people accessing the PageMeta directly. I will fix it (in some way).

In the mean time, you can change

.PageMeta.ReadingTime

to

.ReadingTime

Thank you. :slight_smile: If the (new) canonical way to access it is .ReadingTime, then I will simply change this in my layout.

It is. I will have to deprecate the “old way” because the new way was put there to speed up sites that don’t use these values.

1 Like

https://github.com/spf13/hugo/issues/2503

Cool. I have updated my templates to access .ReadingTime directly., without going through PageMeta