Skip to content

Commit b7ba1d7

Browse files
authored
Feat: Custom font size and color of tagcloud (#648)
* Add tagcloud option * Update {{ tagcloud }}
1 parent e89fac5 commit b7ba1d7

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

_config.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,21 @@ highlight_theme: normal
384384
cheers: true
385385

386386

387+
# ---------------------------------------------------------------
388+
# Tagcloud Settings
389+
# ---------------------------------------------------------------
390+
391+
tagcloud:
392+
# If true, font size and color can be customized
393+
enable: false
394+
395+
# All values below are same as default, change them by yourself
396+
min: 12 # min font size in px
397+
max: 30 # max font size in px
398+
start: '#ccc' # start color (hex, rgba, hsla or color keywords)
399+
end: '#111' # end color (hex, rgba, hsla or color keywords)
400+
401+
387402
# ---------------------------------------------------------------
388403
# Font Settings. Introduced in NexT v5.0.1.
389404
# Find fonts on Google Fonts (https://www.google.com/fonts)
@@ -394,6 +409,7 @@ cheers: true
394409
# To avoid space between header and sidebar in scheme Pisces / Gemini, Web Safe fonts are recommended for `global` (and `logo`):
395410
# Arial | Tahoma | Helvetica | Times New Roman | Courier New | Verdana | Georgia | Palatino | Garamond | Comic Sans MS | Trebuchet MS
396411
# ---------------------------------------------------------------
412+
397413
font:
398414
enable: false
399415

layout/page.swig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@
4242
{{ _p('counter.tag_cloud', visibleTags) }}
4343
</div>
4444
<div class="tag-cloud-tags">
45-
{{ tagcloud({min_font: 12, max_font: 30, amount: 300, color: true, start_color: '#ccc', end_color: '#111'}) }}
45+
{% if not theme.tagcloud %}
46+
{{ tagcloud({min_font: 12, max_font: 30, amount: 300, color: true, start_color: '#ccc', end_color: '#111'}) }}
47+
{% else %}
48+
{{ tagcloud({min_font: theme.tagcloud.min, max_font: theme.tagcloud.max, amount: 300, color: true, start_color: theme.tagcloud.start, end_color: theme.tagcloud.end}) }}
49+
{% endif %}
4650
</div>
4751
</div>
4852
{% elif page.type === 'categories' %}

0 commit comments

Comments
 (0)