Skip to content

Commit 07a2e05

Browse files
authored
Add custom favicon if needed (alshedivat#386)
1 parent c37abc4 commit 07a2e05

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

_config.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ footer_text: >
1616
keywords: jekyll, jekyll-theme, academic-website, portfolio-website # add your own keywords or leave empty
1717

1818
lang: en # the language of your site (for example: en, fr, cn, ru, etc.)
19-
icon: 🔥 # the emoji used as the favicon
19+
icon: 🔥 # the emoji used as the favicon (alternatively, provide image name in /assets/img/)
20+
2021
url: https://alshedivat.github.io # the base hostname & protocol for your site
2122
baseurl: /al-folio # the subpath of your site, e.g. /blog/
2223
last_updated: false # set to true if you want to display last updated in the footer

_includes/head.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<!-- Metadata, OpenGraph and Schema.org -->
32
{% include metadata.html %}
43

@@ -15,9 +14,11 @@
1514
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jwarby/jekyll-pygments-themes@master/{{ site.highlight_theme_light | append: '.css' }}" media="none" id="highlight_theme_light" />
1615

1716
<!-- Styles -->
18-
{% if site.icon != empty -%}
19-
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>{{ site.icon }}</text></svg>">
20-
{%- endif %}
17+
{% if site.icon.size == 1 %}
18+
<link rel="shortcut icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>{{ site.icon }}</text></svg>">
19+
{% elsif site.icon != blank %}
20+
<link rel="shortcut icon" href="{{ site.icon | prepent: '/assets/img/' | relative_url}}"/>
21+
{% endif %}
2122
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
2223
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
2324

0 commit comments

Comments
 (0)