HugoMDL icon indicating copy to clipboard operation
HugoMDL copied to clipboard

Issues with mdlPrimary & mdlSecondary

Open dvelasquez opened this issue 7 years ago • 3 comments

Hi guys, i was having some issues trying to change the default Grey - Orange MDL palette set.

So, making some adjustments i was able to fix this.

First, changing config.toml:

  mdlPrimary = "red" 
  mdlAccent = "indigo"

and in header.html

<!-- Allow user to choose MDL theme -->
    {{- if .Site.Params.mdlPrimary }}
        {{- $.Scratch.Set "mdlPrimary" .Site.Params.mdlPrimary }}
    {{- else }}
        {{- $.Scratch.Set "mdlPrimary" "grey" }}
    {{- end }}
    {{- if .Site.Params.mdlAccent }}
        {{- $.Scratch.Set "mdlAccent" .Site.Params.mdlAccent }}
    {{- else }}
        {{- $.Scratch.Set "mdlAccent" "orange" }}
    {{- end -}}

I'm not really sure if this is a problem with the version of hugo im using (v0.19 windows x64) or if is another issue, but anyway, changing this i was able to made the palette changes.

dvelasquez avatar Mar 19 '17 22:03 dvelasquez

That solution worked for me, thanks!

tvories avatar Apr 22 '17 00:04 tvories

Hi! I faced into this problem and according to hugo docs (https://gohugo.io/functions/isset/) the key must be in lowercase when used with isset.

These fixed the problem:

{{- if isset .Site.Params "mdlprimary" }}
...
{{- if isset .Site.Params "mdlaccent" }}

diegodalbosco avatar Dec 17 '17 16:12 diegodalbosco

sample config.toml file also references mdlSecondary instead of mdlAccent

eeyan avatar Dec 31 '18 19:12 eeyan