components/social_links
Danh sách liên kết mạng xã hội từ thiết lập giao diện social_facebook, social_youtube, social_tiktok, social_zalo, social_instagram.
- Tệp giao diện:
components/social_links.html
Biến đầu vào
Component đọc biến có sẵn tại chỗ chèn. Những biến dưới đây phải tồn tại, nếu không component sẽ dựng ra khối rỗng.
Chưa có mục nào.
Cách chèn
{% for in s %}
{% include 'components/social_links' %}
{% endfor %}
Đường dẫn trong {% include %} tính từ gốc bộ giao diện và không có đuôi .html.
Mã đầy đủ
Toàn bộ tệp components/social_links.html của bộ giao diện mặc định.
{%- comment -%}Liên kết mạng xã hội từ Thiết lập giao diện (social_*). Chỉ hiện mục có đường dẫn.{%- endcomment -%}
<ul class="social-links">
{%- if settings.social_facebook != empty -%}<li><a href="{{ settings.social_facebook | escape }}" target="_blank" rel="noopener" aria-label="Facebook"><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M14 8h3V4h-3a4 4 0 0 0-4 4v2H8v4h2v8h4v-8h3l1-4h-4V8z"/></svg></a></li>{%- endif -%}
{%- if settings.social_youtube != empty -%}<li><a href="{{ settings.social_youtube | escape }}" target="_blank" rel="noopener" aria-label="YouTube"><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M23 7.2a3 3 0 0 0-2.1-2.1C19 4.6 12 4.6 12 4.6s-7 0-8.9.5A3 3 0 0 0 1 7.2 31 31 0 0 0 .5 12a31 31 0 0 0 .5 4.8 3 3 0 0 0 2.1 2.1c1.9.5 8.9.5 8.9.5s7 0 8.9-.5a3 3 0 0 0 2.1-2.1 31 31 0 0 0 .5-4.8 31 31 0 0 0-.5-4.8zM9.8 15V9l5.7 3-5.7 3z"/></svg></a></li>{%- endif -%}
{%- if settings.social_tiktok != empty -%}<li><a href="{{ settings.social_tiktok | escape }}" target="_blank" rel="noopener" aria-label="TikTok"><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M16.5 2h-3.3v13.3a2.9 2.9 0 1 1-2.9-2.9c.3 0 .6 0 .8.1V9.2a6.2 6.2 0 1 0 5.4 6.1V8.6a7.6 7.6 0 0 0 4.5 1.5V6.8a4.5 4.5 0 0 1-4.5-4.8z"/></svg></a></li>{%- endif -%}
{%- if settings.social_zalo != empty -%}<li><a href="{{ settings.social_zalo | escape }}" target="_blank" rel="noopener" aria-label="Zalo"><span class="social-links__text" aria-hidden="true">Zalo</span></a></li>{%- endif -%}
{%- if settings.social_instagram != empty -%}<li><a href="{{ settings.social_instagram | escape }}" target="_blank" rel="noopener" aria-label="Instagram"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="5"/><circle cx="12" cy="12" r="4"/><circle cx="17.5" cy="6.5" r="1" fill="currentColor"/></svg></a></li>{%- endif -%}
</ul>
Dùng ở
Chưa có mục nào.