-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error :Liquid Exception: comparison of Array with Array failed in page #1
Comments
It's a math problem in the plugin. weighted = count.map do |name, count|
# logarithmic distribution
weight = (Math.log(count) - Math.log(min))/(Math.log(max) - Math.log(min))
[name, weight]
end to this: weighted = count.map do |name, count|
# logarithmic distribution
if min == max
weight = 1
else
weight = (Math.log(count) - Math.log(min))/(Math.log(max) - Math.log(min))
end
[name, weight]
end I hope it works for everybody... |
or
-----------------yeah,, these can remove that exception。。。 I |
taringamberini
added a commit
to taringamberini/octopress-tag-cloud
that referenced
this issue
Jul 5, 2015
PROBLEM When every page which declares tag has the same tags then running: $ rake generate the plugins breaks with the following exception: ## Generating Site with Jekyll write source/stylesheets/screen.css Configuration file: ... /_config.yml Source: source Destination: public Generating... Liquid Exception: comparison of Array with Array failed in _layouts/page.html jekyll 2.5.3 | Error: comparison of Array with Array failed CAUSE When each tag occures the same number of times, calculated over all the posts, then in the logarithmic distribution expression: # logarithmic distribution weight = (Math.log(count) - Math.log(min))/(Math.log(max) - Math.log(min)) `min` is equal to `max` so `weight` assume the value `NaN` which make comparison with numbers fails. SOLUTION Use logarithmic distribution only if `min` is not equals to `max` otherwise use the value: # value which makes the font-size calculated below equal to 100% weight = (100 - size_min) / (size_max - size_min) The value proposed for `weight` is the one which makes the font-size calculated few lines below equals to 100%: size = size_min + ((size_max - size_min) * weight).to_f in other words as none of each tag occures more then another one then all tags font-size must be the same: 100% is exactly the font-size of the text in the same block either `<article>` or `<aside>`. robbyedwards#1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I added example tags.html tag_cloud to my custom aside with tag_cloud plugin, and run "rake generate", it said error:
/Users/daxiawj/Workspace/octopress/plugins/tag_cloud.rb:76:in
sort!' /Users/daxiawj/Workspace/octopress/plugins/tag_cloud.rb:76:in
render'I don't know what's wrong with my files or configurations.
btw, my tag_pages works fine.
The text was updated successfully, but these errors were encountered: