Does it matter if I use contains vs == to match a URL in the link list? Does it have a performance hit?
I use if statement to show icons next to any of my social media links. Like so:
{% if child_link.url == "https://instagram.com/username" %}
Instagram
{% elsif child_link.url == "https://www.facebook.com/username" %}
Facebook
{% elsif child_link.url == "https://www.youtube.com/user/username/videos" %}
YouTube
{% elsif child_link.url == "https://twitter.com/username" %}
Twitter
{% else %}
{% endif %}
Can I use contains instead so I don’t have to specify the exact URL?
Will there be a big performance hit using this in the footer on every page of the site?
{% if child_link.url contains "instagram" %}
Instagram
{% elsif child_link.url contains "facebook" %}
Facebook
{% elsif child_link.url contains "youtube" %}
YouTube
{% elsif child_link.url contains "twitter" %}
Twitter
{% else %}
{% endif %}