Hello,
Thank you for the great work and awesome support.
Hugo is great for sites where content is written in .md files and we can use shortcodes here and there for more power. But if we want custom landing pages with section widgets, without repeating a lot of partials code, it needs some “hacks”. Bellow is a repo where i tried to create a landing page like i do with wordpress + ACF
I have some issues:
- trying to use .Scratch in a partial for advance classes without luck
- dot separated path for data file with index, without hardcoding
- I passed the current context as “el” and also the $.Site as “site” in the range, and when i try
{{ .site.Scratch.Set "classes" (slice "rp-body") }} // in the cs-left.html
ERROR 2017/12/26 21:25:42 Error while rendering "page": template: /.../hugo-test/layouts/landing/page-builder.html:9:7: executing "main" at <partial $widget (dic...>: error calling partial: template: partials/page-builder/cs-left.html:1:8: executing "partials/page-builder/cs-left.html" at <.site.Scratch.Set>: can't evaluate field Scratch in type interface {}
- In the content/invoices.md i have a cdata param, and in layouts/landing/page-builder i have 2 index searches and a hardcoded folder “landing” index $language.landing how can i use something more general like cdata: landing.invoices in the index search.
Here is the test repo.
PS: I talked with forestry.io, and they will take it in account to have nested data files structure, and they use this technique for an enterprise client.