Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with mdlPrimary & mdlSecondary #14

Open
dvelasquez opened this issue Mar 19, 2017 · 3 comments
Open

Issues with mdlPrimary & mdlSecondary #14

dvelasquez opened this issue Mar 19, 2017 · 3 comments

Comments

@dvelasquez
Copy link

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.

@tvories
Copy link

tvories commented Apr 22, 2017

That solution worked for me, thanks!

@diegodalbosco
Copy link

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" }}

@eeyan
Copy link

eeyan commented Dec 31, 2018

sample config.toml file also references mdlSecondary instead of mdlAccent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants