{% comment %} # ----------------------------------------------------------------------------- # ~/_includes/themes/j1/procedures/components/create_word_cloud.proc # Liquid PROCEDURE to create a word cloud from a list of comma separated # words. # # https://jekyll.one # # Copyright (C) 2022 Juergen Adams # # J1 Template is licensed under the MIT License. # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE # # ----------------------------------------------------------------------------- # Components procedure. Create the HTML code (to be included in a page) for # a word cloud generated from a LIST of comma separated WORDS. All words are # counted against a given SOURCE (how often they are found). # Supported SOURCES are: tags|categories # # Usage: # 1) assign the 'source' and 'word_list' variables # 2) include the create_word_cloud.proc procedure # # Example: # # {% capture create_word_cloud %}themes/{{site.template.name}}/procedures/global/create_word_cloud.proc{% endcapture %} # # {% capture my_site_tag_list %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %} # {% include {{create_word_cloud}} source="tags" word_list=my_site_tag_list %} # # ----------------------------------------------------------------------------- # Test data: # liquid_var: {{ liquid_var | debug }} # # ----------------------------------------------------------------------------- {% endcomment %} {% comment %} Liquid procedures -------------------------------------------------------------------------------- {% endcomment %} {% comment %} Variables -------------------------------------------------------------------------------- {% endcomment %} {% assign source = include.source %} {% assign word_list = include.word_list %} {% assign word_array = word_list | split:',' | sort %} {% if source == 'categories' %} {% assign categories = site.categories | sort %} {% endif %} {% comment %} Main -------------------------------------------------------------------------------- jadams, 2020-07-24: style cart creates a unwanted border, removed card styles jadams, 2020-07-24: class "cart" is NOT longer overloaded since CSS generation has changed {% capture href %}#{{tag|downcase|prepend: site.baseurl}}{% endcapture %} -------------------------------------------------------------------------------- {% endcomment %}