dirkolbrich / hugo-tailwindcss-starter-theme

Starter files for a Hugo theme with Tailwindcss
MIT License
401 stars 55 forks source link

can't evaluate field PostProcess in type interface #15

Closed abadger1406 closed 4 years ago

abadger1406 commented 4 years ago
Building sites … ERROR 2020/05/11 10:38:23 render of "page" failed: execute of template failed: template: _default/single.html:3:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/dave/vee/web/themes/new-theme-name/layouts/partials/head.html:22:50": execute of template failed: template: partials/head.html:22:50: executing "partials/head.html" at <resources>: can't evaluate field PostProcess in type interface {}
ERROR 2020/05/11 10:38:23 render of "page" failed: execute of template failed: template: _default/single.html:3:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/home/dave/vee/web/themes/new-theme-name/layouts/partials/head.html:22:50": execute of template failed: template: partials/head.html:22:50: executing "partials/head.html" at <resources>: can't evaluate field PostProcess in type interface {}
abadger1406 commented 4 years ago

hugo serve -D works fine.

This looks related:-

https://discourse.gohugo.io/t/cant-evaluate-field-postprocess-in-type-interface-when-using-snippet-from-docs/25170

Everything was fine, then decided to upgrade to your latest version. This was tricly as had to copy in the shortcodes, etc. So maybe it's an error my end. Any help in resolving would be good.

dirkolbrich commented 4 years ago

What is your Hugo version? Please run hugo version in your terminal.

dirkolbrich commented 4 years ago

build and server work on my machine™. Make sure to run on Hugo v0.69 and upwards.

abadger1406 commented 4 years ago

remove resouces.PostProcess from head.html fixes issue

<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ block "title" . }}
{{- .Title }} - {{ .Site.Title -}}
{{ end }}</title>
{{ if .Description }}
<meta name="description" content="{{ .Description }}" />
{{ end }}
{{ if .Keywords }}
<meta name="keywords" content="{{ delimit .Keywords "," }}" />
{{ end }}
{{ if .Params.Author }}
<meta name="author" content="{{ .Params.Author}}" />
{{ end }}
{{ hugo.Generator }}

{{ $styles := resources.Get "css/styles.css" | postCSS (dict "config" "./assets/css/postcss.config.js") }}
{{ if .Site.IsServer }}
    <link rel="stylesheet" href="{{ $styles.RelPermalink }}">
{{ else }}
    {{ $styles := $styles| minify | fingerprint }}
    <link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}">
{{ end }}
abadger1406 commented 4 years ago

hugo version reported 68

upgraded to latest 0.70 and all okay - I think you need version0.69 for PostProcess to work:-

https://gohugo.io/hugo-pipes/postprocess/

dirkolbrich commented 4 years ago

;-)