victor-hugo
victor-hugo copied to clipboard
Can’t evaluate field Related in type hugolib.Pages
- Do you want to request a feature or report a bug? Bug report
- What is the current behavior? When .Related is called, as in .Site.RegularPages.Related, the message "Can’t evaluate field Related in type hugolib.Pages" The same site does not return an error when built with hugulp.
- If the current behavior is a bug, please provide the steps to reproduce.
- Add a partial related.html with the following code.
- Configure the config.toml.
- Call related from single.html
- What is the expected behavior? Should see a list of related posts generated at the bottom of each blog post.
- Please mention your node.js, NPM, Hugo and operating system version.
- Node v8.9.1
- npm: '5.5.1'
- Hugo Static Site Generator v0.31.1
- Ubuntu 16.04.3 LTS
I believe bep was right when you asked this on the Hugo forum - you're calling .Related
on a list of pages rather than an individual Page
.
Ah, nope, you're right: https://gohugo.io/content-management/related/#list-related-content
I have had no problems running the exact same code with base Hugo or with Hugulp. The problem has been unique to Victor Hugo.