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

Merged
merged 2 commits into from May 31, 2014

Conversation

Projects
None yet
2 participants
Contributor

saivann commented May 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 column we 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

saivann added a commit that referenced this pull request May 31, 2014

Merge pull request #433 from bitcoin/langmenumodulo
Use modulo instead of cycle to split language menu

@saivann saivann merged commit b08a795 into master May 31, 2014

@saivann saivann deleted the langmenumodulo branch May 31, 2014

Contributor

wbnns commented Jun 2, 2014

@saivann - thanks for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment