pattern-lab / styleguidekit-assets-default

The static assets for the default StyleguideKit for Pattern Lab. Contains styles and mark-up for Pattern Lab's front-end.
http://patternlab.io/
MIT License
35 stars 67 forks source link

Displaying theme object inside of PL files #103

Open bradfrost opened 6 years ago

bradfrost commented 6 years ago

@bmuenzenmeyer @EvanLovely:

This is likely a Very Dumb Question from Brad, but here it goes: I see that the theme object is available in the browser (if I open the console and type theme it returns the object); how do I get the info within theme to display in, say, html/partials/header.html?

I know we are using Hogan to render our templates, but I'm scratching my head why adding {{ theme.logoImage }} isn't printing out the path to the logo.

Forgive the dumbness of the question, but once I have an idea of how to work with the theme object in this repo, I can get everything wired up!

bmuenzenmeyer commented 6 years ago

@bradfrost It's not a dumb question at all.

Take a look at the commit above on the theme-in-header branch - the partial was not being processed as a Hogan template, like some of its siblings were. It was only being included using the code here: https://github.com/pattern-lab/styleguidekit-assets-default/blob/develop/gulpfile.js#L59

Anyway, I committed it with obviously poor UX of actually displaying the theme content.

Make changes as you see fit, run gulp --copy-dist=../../../public and you are on your way.

Feel free to continue working off of this branch if you like.

Aside

I also see that you are starting work inside feature-themes, but you should really be branching off of develop per the guidelines, otherwise we will be diverging from all that work like last time.

image

bradfrost commented 6 years ago

@bmuenzenmeyer Thanks a ton for this! This all makes sense to me.

I also see that you are starting work inside feature-themes, but you should really be branching off of develop per the guidelines, otherwise we will be diverging from all that work like last time.

Forgive me, I still feel like I'm all thumbs with this process. Can I just work in theme-in-header for now for this stuff?

bmuenzenmeyer commented 6 years ago

You betcha.

bradfrost commented 6 years ago

Cool, thanks @bmuenzenmeyer. I've committed changes here: https://github.com/pattern-lab/styleguidekit-assets-default/commit/1b9b4a031ae16d73b036d3df5e90d6d1373dccb7

Any way you could give a quick glance and a thumbs up just to see if I'm not screwing things up? With so many branches and stuff swirling around, I'm still struggling to get my head around where I should be doing work. Sorry for being dumb!

bmuenzenmeyer commented 6 years ago

@bradfrost 👍

bradfrost commented 6 years ago

Awesome thanks!

bradfrost commented 6 years ago

Alright, I may have closed this too soon. Next thing I need to do is to get stuff inside the iframe listening to the config. Is that possible/easy?

bmuenzenmeyer commented 6 years ago

as in, individual patterns?

bradfrost commented 6 years ago

As in, inside the viewall template and individual patterns. Basically anything that's inside the iframe.