riboseinc / jekyll-theme-open-project

Jekyll theme for site suite presenting your open software and specifications.
MIT License
30 stars 3 forks source link

Added reusable button for tutorials #81

Closed kickoke closed 2 years ago

kickoke commented 2 years ago

I'm currently working on our tutorial content to get it published. Instead of just providing a link to the next lesson, I wanted to make the action item clearer and use a button, like this: image In order to do that, I need a button in the _includes folder.

ronaldtse commented 2 years ago

Thanks @kickoke ! @strogonoff could you help? Thanks.

kickoke commented 2 years ago

@strogonoff @ronaldtse FYI: I found out today that the "include" mechanism was deprecated. Liquid (5.0.0) now uses "render". We might want to check how this impacts our codebase. Maybe another reason to migrate to another platform in the long run? https://www.shopify.com/partners/blog/88186566-tips-for-using-snippets-in-your-shopify-theme

strogonoff commented 2 years ago

Currently, this theme provides a cta-button mixin. It can be given background and foreground, and it produces style rules for a similar button as shown in your reference image.

Metanorma.org site actually uses this mixin for the “Get started” button in the authoring section, giving it nothing as background and primary color as foreground:

Screenshot 2022-01-17 at 4 01 53 PM

It looks like what you want may better be achieved by adding a similar cta-button() invocation somewhere else in metanorma.org/_sass/metanorma-rules.scss, scoped appropriately to page class, and with a different choice of background and foreground colors (I recommend to use variables defined by the site, Metanorma.org, for primary/primary-dark colors).


More technically, I don’t want to merge it yet even if my comments are addressed, since the way it is currently implemented does not fit into theme architecture and it’s not quite clear whether the component is called for:

kickoke commented 2 years ago

We can close this PR, since I managed to create Buttons in the metanorma.org repo.

strogonoff commented 2 years ago

@strogonoff @ronaldtse FYI: I found out today that the "include" mechanism was deprecated. Liquid (5.0.0) now uses "render". We might want to check how this impacts our codebase. Maybe another reason to migrate to another platform in the long run? https://www.shopify.com/partners/blog/88186566-tips-for-using-snippets-in-your-shopify-theme

@kickoke please note that when you research Liquid syntax, you will find two sources:

While Shopify’s Liquid is broadly similar, it is trending to differ from Jekyll’s Liquid. I’m not sure whether they have plans to consolidate or not.

Sometimes Shopify’s documentation has something that Jekyll’s documentation misses, but the caveat is that other parts of Shopify’s documentation do not apply to Jekyll. (The part about includes doesn’t.)