Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Use modulo instead of cycle to split language menu #433
Conversation
saivann
added some commits
May 29, 2014
saivann
added a commit
that referenced
this pull request
May 31, 2014
saivann
merged commit b08a795
into
master
May 31, 2014
saivann
deleted the
langmenumodulo branch
May 31, 2014
|
@saivann - thanks for doing this! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
saivann commentedMay 29, 2014
The jekyll {% cycle %} code is a little hard to understand, easy to break, and hard to update each time we need to change the number of languages displayed per column (so we don't end with a single language in the last column).
By using modulo and divided_by,
we would only need to edit "modulo:11" to set a different number of languages per columnwe can automate the number of languages per column, and edit "divided_by: 2" to set a different number of columns. This seems a more elegant solution to me.The modulo filter has been added to liquid in 2011 and seems supported even by old jekyll versions:
Shopify/liquid@c4d713b