{% import "../helpers/general.html" %} {% import "./link.html" %} {% macro socialLinkComponent(data) %} {% set args = { "network" : "", "custom_label" : "", "layout" : { "show_labels": true }, "link" : {}, "class" : '' } %} {% do args.update(data) %} {# map #} {% set networkMap = { "facebook" : { "label" : "Facebook", "iconClass" : "fab fa-facebook"}, "instagram" : { "label" : "Instagram", "iconClass" : "fab fa-instagram"}, "spotify" : { "label" : "Spotify", "iconClass" : "fab fa-spotify"}, "tiktok" : { "label" : "TikTok", "iconClass" : "fab fa-tiktok"}, "soundcloud" : { "label" : "SoundCloud", "iconClass" : "fab fa-soundcloud"}, "snapchat" : { "label" : "Snapchat", "iconClass" : "fab fa-snapchat"}, "youtube" : { "label" : "YouTube", "iconClass" : "fab fa-youtube"}, "twitter" : { "label" : "Twitter", "iconClass" : "fab fa-twitter"}, "mixcloud" : { "label" : "Mixcloud", "iconClass" : "fab fa-mixcloud"}, "googleplus" : { "label" : "Google Plus", "iconClass" : "fab fa-google-plus"}, "linkedin" : { "label" : "LinkedIn", "iconClass" : "fab fa-linkedin"}, "whatsapp" : { "label" : "WhatsApp", "iconClass" : "fab fa-whatsapp"}, "vimeo" : { "label" : "Vimeo", "iconClass" : "fab fa-vimeo"}, "hashtag" : { "label" : slugify(theme_meta.name)|replace('-',''), "iconClass" : "fas fa-hashtag"}, "grid" : { "label" : theme_meta.name, "iconClass" : "fas fa-th"}, "rss" : { "label" : theme_meta.name, "iconClass" : "fas fa-rss"} } %} {% set selectedNetwork = networkMap|attr(args.network) || { label : "Unknown", iconClass : "fas fa-question"} %}
{% set linkOutput %} {% set linkData = { "link" : { "url" : args.link, "open_in_new_tab" : true }, "class" : "d-flex align-items-center link-primary-hover " + (!!args.layout.show_labels ? 'fs-4' : 'fs-2') } %} {% call maybeLink(linkData) %} {% if selectedNetwork.iconClass %} {% endif %} {% if !!args.layout.show_labels %} {{ args.custom_label || selectedNetwork.label }} {% endif %} {% endcall %} {% endset %} {{ linkOutput }}
{% endmacro %} {% macro socialLinksComponent(data = {}) -%} {% set args = { "links" : [], "layout" : {}, "class" : "", "linkClass" : "link-inherit", } %} {% do args.update(data) %} {# Get Enabled #} {% set links = [] %} {% for item in args.links %} {% if item %} {% do item.update({ "visible" : ((item.visible is defined && item.visible) || item.visible is not defined), "layout" : args.layout || {} }) %} {% do links.append(item) %} {% endif %} {% endfor %} {% set forceInline = !args.layout.show_labels %} {% set columns = !forceInline && !!(args.layout.columns|int > 0) ? (args.layout.columns|int || 3) : false %} {% endmacro %} 12/3 = 4 6/3 = 2 = 6 12/2 = 6 6/2 = 3 = 6