raviriley / agency-jekyll-theme

Jekyll version of the newest Agency Bootstrap theme, plus new features: Google Analytics, Markdown support, custom pages, and more!
https://raviriley.github.io/agency-jekyll-theme-starter/
MIT License
347 stars 689 forks source link

Automatically align items in timeline #9

Closed xsuchy closed 4 years ago

xsuchy commented 4 years ago

You can define:

timeline: start_align: "right"

and then the timeline starts aligned to right and then continue switching. The default is: start_align: "left"

You can always enforce the order by:

which will enforce the alignment to the right and the next one will continue on left.

raviriley commented 4 years ago

I'm not sure if this would work if there is no start_align entry in sitetext.yml. Correct me if I'm wrong 👍 . This would be fixed by adding a default liquid tag | default:. Also if the user specifies something like the following:

align: right align: left align: left align: left align: right

Does your addition produce the desired alignment?

xsuchy commented 4 years ago

If there is no start_align then the first

  if align == "right" 

will be False and it will be aligned to left. At the end of the else branch will be assigned "right" to "align" and the next iteration will be right-aligned. So left->right. And yes, I tried that.

If the user manually specifies align then it will be honored.

E.g.

align: right align: left align: left align: left align: right

will be honored. And

align: right align: left align: left //# one item with omited align align: right

will produce

right left left right right

raviriley commented 4 years ago

Got it, thanks for clarifying!