Skip to content

Commit

Permalink
feat(amsf): better Safari mask icon support
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Jan 16, 2017
1 parent 623a4f3 commit ba286ca
Showing 1 changed file with 51 additions and 40 deletions.
91 changes: 51 additions & 40 deletions _app/_includes/_amsf.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,49 @@
{% endcomment %}
{% capture amsf_user_assets %}{{ site.assets | prepend: site.base }}{% endcapture %}

{% comment %}
Page theme color

Generate page/post theme color based on current config, can used by:
- Custom post link color in article list
- Safari mask icon
- Chrome Web App theme color

@since 1.1.4
{% endcomment %}
{% capture amsf_page_theme_color %}
{% if type.scheme-list-color %}
{% if type.scheme-list-color == 'text' %}
{{ type.scheme-text }}
{% elsif type.scheme-list-color == 'hover' %}
{{ type.scheme-hover }}
{% elsif type.scheme-list-color == 'code' %}
{{ type.scheme-code }}
{% elsif type.scheme-list-color == 'bg' %}
{{ type.scheme-bg }}
{% else %}
{{ type.scheme-link }}
{% endif %}
{% elsif type.scheme-bg %}
{% if type.scheme-bg-light %}
{{ type.scheme-link }}
{% else %}
{{ type.scheme-bg }}
{% endif %}
{% elsif type.scheme-link %}
{{ type.scheme-link }}
{% endif %}
{% endcapture %}

{% capture amsf_page_theme_color_with_fallback %}
{% assign amsf_page_theme_color = amsf_page_theme_color | strip %}
{% if amsf_page_theme_color != "" %}
{{ amsf_page_theme_color }}
{% else %}
{{ site.primary_color }}
{% endif %}
{% endcapture %}

{% comment %}
Favicons

Expand All @@ -83,7 +126,7 @@
{% endif %}

{% if static_file.path == "/mask-icon.svg" %}
<link rel="mask-icon" href="{{ amsf_mask_icon }}" color="{{ site.primary_color }}">
<link rel="mask-icon" href="{{ amsf_mask_icon }}" color="{{ amsf_page_theme_color_with_fallback | strip }}">
{% endif %}

{% if static_file.path == "/apple-touch-icon.png" %}
Expand All @@ -92,6 +135,13 @@
{% endfor %}
{% endcapture %}

{% comment %}
Chrome Web App theme color
{% endcomment %}
{% capture amsf_theme_color %}
{{ amsf_page_theme_color_with_fallback }}
{% endcapture %}

{% comment %}
Feed URL
{% endcomment %}
Expand Down Expand Up @@ -450,45 +500,6 @@
{% endif %}
{% endcapture %}

{% comment %}
Page theme color
{% endcomment %}
{% capture amsf_page_theme_color %}
{% if type.scheme-list-color %}
{% if type.scheme-list-color == 'text' %}
{{ type.scheme-text }}
{% elsif type.scheme-list-color == 'hover' %}
{{ type.scheme-hover }}
{% elsif type.scheme-list-color == 'code' %}
{{ type.scheme-code }}
{% elsif type.scheme-list-color == 'bg' %}
{{ type.scheme-bg }}
{% else %}
{{ type.scheme-link }}
{% endif %}
{% elsif type.scheme-bg %}
{% if type.scheme-bg-light %}
{{ type.scheme-link }}
{% else %}
{{ type.scheme-bg }}
{% endif %}
{% elsif type.scheme-link %}
{{ type.scheme-link }}
{% endif %}
{% endcapture %}

{% comment %}
Chrome Web App theme color
{% endcomment %}
{% capture amsf_theme_color %}
{% assign amsf_page_theme_color = amsf_page_theme_color | strip %}
{% if amsf_page_theme_color != "" %}
{{ amsf_page_theme_color }}
{% else %}
{{ site.primary_color }}
{% endif %}
{% endcapture %}

{% comment %}
Google Analytics tracking code
{% endcomment %}
Expand Down

0 comments on commit ba286ca

Please sign in to comment.