Skip to content

Commit

Permalink
refactor(helper/tagcloud): level false to use same className for each…
Browse files Browse the repository at this point in the history
… tag
  • Loading branch information
ChrAlpha authored Aug 5, 2023
1 parent b267475 commit fc47f12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/plugins/helper/tagcloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function tagcloudHelper(tags, options) {
const className = options.class;
const showCount = options.show_count;
const countClassName = options.count_class || 'count';
const level = options.level || 10;
const level = options.level === false ? false : options.level || 10;
const { transform } = options;
const separator = options.separator || ' ';
const result = [];
Expand Down Expand Up @@ -62,7 +62,7 @@ function tagcloudHelper(tags, options) {
const ratio = length ? sizes.indexOf(tag.length) / length : 0;
const size = min + ((max - min) * ratio);
let style = `font-size: ${parseFloat(size.toFixed(2))}${unit};`;
const attr = className ? ` class="${className}-${Math.round(ratio * level)}"` : '';
const attr = className ? ` class="${className}${level === false ? '' : '-' + Math.round(ratio * level)}"` : '';

if (color) {
const midColor = startColor.mix(endColor, ratio);
Expand Down

0 comments on commit fc47f12

Please sign in to comment.