Regular improvement for liquid code

This commit is contained in:
Cotes Chung 2020-12-05 02:44:28 +08:00
parent 13aca77275
commit 5d6014ecee
2 changed files with 4 additions and 10 deletions

View file

@ -75,7 +75,7 @@
{%- endif -%} {%- endif -%}
{% endcapture %} {% endcapture %}
{% if url != '' %} {% if url %}
<a href="{{ url }}" aria-label="{{ entry.type }}" {% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}> <a href="{{ url }}" aria-label="{{ entry.type }}" {% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
<i class="{{ entry.icon }}"></i> <i class="{{ entry.icon }}"></i>
</a> </a>

View file

@ -9,19 +9,13 @@ layout: compress
<!DOCTYPE html> <!DOCTYPE html>
{% if site.lang %}
{% assign lang = site.lang | split: "_" | first %}
{% else %}
{% assign lang = 'en' %}
{% endif %}
{% capture prefer_mode %} {% capture prefer_mode %}
{% if site.theme_mode != "dual" %} {% unless site.theme_mode == "dual" %}
mode="{{ site.theme_mode }}" mode="{{ site.theme_mode }}"
{% endif %} {% endunless %}
{% endcapture %} {% endcapture %}
<html lang="{{ lang }}" {{ prefer_mode }} > <html lang="{{ site.lang | split: "_" | first | default: "en" }}" {{ prefer_mode }} >
{% include head.html %} {% include head.html %}