Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Lewis Cowles
Lewis Cowles
74,902 Points

Why won't my shopify liquid work with gh-pages Jekyll? :sadface:

Hi,

During the intro to Jekyll and subsequent Jekyll courses with Guil, I noticed that Jekyll uses the same liquid layout as shopify. Great I thought, I can use my same code in two places. Sadly Jekyll, and github-pages Jekyll seems to use an alternate syntax to shopify :(

Had to manually port the shortcode lib I was using, the carousel I was using, the google-maps I was using, and still have my favicons & social scripts to go...

Oh one last thing. The Jekyll courses were amazing, maybe a course on integrating them with active data-sources like ruby sites, PHP, or firebase API?

2 Answers

Shopify actually does use liquid. So your problem is not with syntax.

What is missing are some of the filters and other plugins that Shopify offers. Liquid is just a templating system, like handlebars or HAML, etc.

Thus, both Jekyll and Shopify are a tool and SAAS (respectively) which implement Liquid templating using their own respective bundles of plugins and filters and such.

You can see the Liquid documentation for each:

https://docs.shopify.com/themes/liquid-documentation/basics

http://jekyllrb.com/docs/templates/

Also, acknowledging that you may already know this, and that this could be nitpicking over the semantics of the word syntax:

https://en.wikipedia.org/wiki/Syntax_(programming_languages)

You will want to use this word carefully because other developers will get nitpicky over how you use it (for example, in job interviews).

Excellent work on porting the functionality over though, seems like you worked around the problems successfully which is what is most important!

Lewis Cowles
Lewis Cowles
74,902 Points

Thanks Rikki,

I hope the recruitment consulting is going well for you!

I know what language shopify uses for it's front-end templates buddy,

Great I thought, I can use my same code in two places. Sadly Jekyll, and github-pages Jekyll seems to use an alternate syntax to shopify :(

It's why I was making the point, why I mentioned that I had hoped to benefit from some cross-over, and wondered why would something basic like include behave differently... It looks like the colon comma syntax is older, and because of issues, maybe with the parsers, they changed it to the syntax I am adjusting my code to :).

You can check it out at The shopify docs

Or The Jekyll docs

Jekyll, seems not to support the shopify syntax of colons and comma's, or at least it's not as stable as in shopify.

Shopify actually does support Jekyll syntax of spaces and = rather than colon's and comma's, which is awesome, means I can reuse code once moved to the = syntax; it's just a bummer that it's not a two-way street.

Oh and as for my definition of syntax

"In computer science, the syntax of a computer language is the set of rules that defines the combinations of symbols that are considered to be a correctly structured document or fragment in that language." - From your own Wikipedia article...

Yeah, so exactly what I was saying, it requires me to type different symbols to structure the same document ;)

Liquid class reference at Rubydoc.info

Whoops, I mistook this for a beginner question and misread it. I've seen new frontend folks who are new to Jekyll/Shopify ask similar questions. I've never worked with Shopify so I didn't know that actually were major syntax differences. Makes a lot more sense now. Feeling foolish. But hey maybe being snobby isn't necessary, especially when I was just trying to be helpful!

I've been evaluating treehouse for some friends who want to learn web development, so I probably appear pretty entry level on here, despite being 6 years in. You seem to be incredibly talented!

Lewis Cowles
Lewis Cowles
74,902 Points

Hey Ricky,

Nobody has been snobby with you mate, I just made a joke about getting hired (I run my own business), and responded with other links. The reason I downvoted was because I felt you hadn't answered the post, which you just yourself said you hadn't.

Don't worry, Treehouse wont deduct points, it won't reflect on either of us, this thread will probably get lost in the wind; don't worry about it..

I Hope you <3 treehouse as much as I do, and recommend it to your buddy too. There is so much to learn, especially right now with a new stack or language hitting the market every few months, and it at the very least is a very cost-effective way of learning enough about some tech, and processes to decide to learn more. More advanced content is coming, they have some intermediate stuff already, but it's better than Lynda and coursera by a mile.

Anyway thanks for the compliament, I am sure you are not at all entry level, even if you were it's none of my business, we have all been there; and I'm sure you could school me. Have a great week!