Explorar el Código

Make favicons optional

Most users of the theme do not set any favicon. It results in useless
HTTP requests

Fix #21
Talha Mansoor hace 11 años
padre
commit
fee5aa233f
Se han modificado 2 ficheros con 10 adiciones y 7 borrados
  1. 1 7
      templates/base.html
  2. 9 0
      templates/favicon_links.html

+ 1 - 7
templates/base.html

@@ -30,13 +30,7 @@
         <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/custom.css" media="screen">
         {% endif %}
         {% endblock head_links %}
-        <link rel="shortcut icon" href="{{ SITEURL }}/theme/images/favicon.ico" type="image/x-icon" />
-        <link rel="apple-touch-icon" href="{{ SITEURL }}/theme/images/apple-touch-icon.png" />
-        <link rel="apple-touch-icon" sizes="57x57" href="{{ SITEURL }}/theme/images/apple-touch-icon-57x57.png" />
-        <link rel="apple-touch-icon" sizes="72x72" href="{{ SITEURL }}/theme/images/apple-touch-icon-72x72.png" />
-        <link rel="apple-touch-icon" sizes="114x114" href="{{ SITEURL }}/theme/images/apple-touch-icon-114x114.png" />
-        <link rel="apple-touch-icon" sizes="144x144" href="{{ SITEURL }}/theme/images/apple-touch-icon-144x144.png" />
-        <link rel="icon" href="{{ SITEURL }}/theme/images/apple-touch-icon-144x144.png" />
+        {% include 'favicon_links.html' %}
         {% block feed_links %}
         {% include 'feeds.html' %}
         {% endblock feed_links %}

+ 9 - 0
templates/favicon_links.html

@@ -0,0 +1,9 @@
+{%if USE_FAVICON %}
+        <link rel="shortcut icon" href="{{ SITEURL }}/theme/images/favicon.ico" type="image/x-icon" />
+        <link rel="apple-touch-icon" href="{{ SITEURL }}/theme/images/apple-touch-icon.png" />
+        <link rel="apple-touch-icon" sizes="57x57" href="{{ SITEURL }}/theme/images/apple-touch-icon-57x57.png" />
+        <link rel="apple-touch-icon" sizes="72x72" href="{{ SITEURL }}/theme/images/apple-touch-icon-72x72.png" />
+        <link rel="apple-touch-icon" sizes="114x114" href="{{ SITEURL }}/theme/images/apple-touch-icon-114x114.png" />
+        <link rel="apple-touch-icon" sizes="144x144" href="{{ SITEURL }}/theme/images/apple-touch-icon-144x144.png" />
+        <link rel="icon" href="{{ SITEURL }}/theme/images/apple-touch-icon-144x144.png" />
+{% endif %}