Skip to content

Commit

Permalink
Add favicon to theme settings (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Berthe committed Jul 5, 2021
1 parent cf7156f commit a38c778
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/settings_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,5 +250,16 @@
"info": "t:settings_schema.social-media.settings.social_vimeo_link.info"
}
]
},
{
"name": "t:settings_schema.favicon.name",
"settings": [
{
"type": "image_picker",
"id": "favicon",
"label": "t:settings_schema.favicon.settings.favicon.label",
"info": "t:settings_schema.favicon.settings.favicon.info"
}
]
}
]
4 changes: 4 additions & 0 deletions layout/password.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<link rel="canonical" href="{{ canonical_url }}">
<link rel="preconnect" href="https://cdn.shopify.com" crossorigin>

{%- if settings.favicon != blank -%}
<link rel="icon" type="image/png" href="{{ settings.favicon | img_url: '32x32' }}">
{%- endif -%}

{%- unless settings.type_header_font.system? -%}
<link rel="preconnect" href="https://fonts.shopifycdn.com" crossorigin>
{%- endunless -%}
Expand Down
4 changes: 4 additions & 0 deletions layout/theme.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<link rel="canonical" href="{{ canonical_url }}">
<link rel="preconnect" href="https://cdn.shopify.com" crossorigin>

{%- if settings.favicon != blank -%}
<link rel="icon" type="image/png" href="{{ settings.favicon | img_url: '32x32' }}">
{%- endif -%}

{%- unless settings.type_header_font.system? -%}
<link rel="preconnect" href="https://fonts.shopifycdn.com" crossorigin>
{%- endunless -%}
Expand Down
9 changes: 9 additions & 0 deletions locales/en.default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@
"info": "https://vimeo.com/shopify"
}
}
},
"favicon": {
"name": "Favicon",
"settings": {
"favicon": {
"label": "Favicon image",
"info": "Will be scaled down to 32 x 32px"
}
}
}
},
"sections": {
Expand Down
4 changes: 4 additions & 0 deletions templates/gift_card.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<link rel="canonical" href="{{ canonical_url }}">
<link rel="preconnect" href="https://cdn.shopify.com" crossorigin>

{%- if settings.favicon != blank -%}
<link rel="icon" type="image/png" href="{{ settings.favicon | img_url: '32x32' }}">
{%- endif -%}

{%- unless settings.type_header_font.system? -%}
<link rel="preconnect" href="https://fonts.shopifycdn.com" crossorigin>
{%- endunless -%}
Expand Down

0 comments on commit a38c778

Please sign in to comment.