chiark / gitweb /
theme: ability to specify a favicon.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 16 Jan 2018 23:15:30 +0000 (00:15 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Wed, 17 Jan 2018 00:46:31 +0000 (01:46 +0100)
38 files changed:
doc/pelican/theme.rst
pelican-theme/templates/archives.html
pelican-theme/templates/article.html
pelican-theme/templates/base_blog.html
pelican-theme/templates/base_blog_section.html
pelican-theme/templates/page.html
pelican-theme/test/blog/archives.html
pelican-theme/test/blog/article-jumbo.html
pelican-theme/test/blog/article.html
pelican-theme/test/blog/author-explicit-author.html
pelican-theme/test/blog/category-another-category.html
pelican-theme/test/blog/index.html
pelican-theme/test/blog/tag-third.html
pelican-theme/test/blog_global_favicon/index.html [new file with mode: 0644]
pelican-theme/test/blog_html_escape/archives.html
pelican-theme/test/blog_html_escape/archives2.html
pelican-theme/test/blog_html_escape/article-jumbo.html
pelican-theme/test/blog_html_escape/article.html
pelican-theme/test/blog_html_escape/author-and-in-author.html
pelican-theme/test/blog_html_escape/author-and-in-author2.html
pelican-theme/test/blog_html_escape/category-and-in-category.html
pelican-theme/test/blog_html_escape/category-and-in-category2.html
pelican-theme/test/blog_html_escape/index.html
pelican-theme/test/blog_html_escape/index2.html
pelican-theme/test/blog_html_escape/tag-and-in-tag.html
pelican-theme/test/blog_html_escape/tag-and-in-tag2.html
pelican-theme/test/layout/features.html
pelican-theme/test/layout/guest-post-howto.html
pelican-theme/test/layout/index.html
pelican-theme/test/layout/showcase-requirements.html
pelican-theme/test/layout_html_escape/index.html
pelican-theme/test/page_html_escape/breadcrumb.html
pelican-theme/test/page_html_escape/content.html
pelican-theme/test/page_html_escape/landing.html
pelican-theme/test/page_html_escape/page.html
pelican-theme/test/test_blog.py
pelican-theme/test/test_layout.py
pelican-theme/test/test_page.py

index 0e43d2828d5f2c8801bc4ca5ae84bb7090f81a2e..7baca8a951092157214b2375d1ea8547043774d3 100644 (file)
@@ -124,6 +124,19 @@ can be either absolute or relative to :py:`SITEURL`. If :py:`M_BLOG_NAME` /
     M_BLOG_NAME = 'Your Brand Blog'
     M_BLOG_URL = 'blog/'
 
+The :py:`M_FAVICON` setting, if present, is used to specify contents of the
+:html:`<link rel="icon">` tag. It's a tuple of :py:`(url, type)` where
+:py:`url` is favicon URL and :py:`type` is its corresponding MIME type. If
+:py:`M_BLOG_FAVICON` is specified, it's overriding :py:`M_FAVICON` on blog-like
+pages (articles, article listing... basically everything except pages). If
+:py:`M_BLOG_FAVICON` is not specified, :py:`M_FAVICON` is used everywhere; if
+neither is specified no :html:`<link>` tag is rendered. Example configuration:
+
+.. code:: py
+
+    M_FAVICON = ('favicon.ico', 'image/x-ico')
+    M_BLOG_FAVICON = ('favicon-blog.png', 'image/png')
+
 `Top navbar`_
 -------------
 
index 7de533a5248ab07e0d4e9b7f565621f02adcf33a..2332d95c02eaf8dcd6ac9ce94e182e9ed8869a8c 100644 (file)
@@ -3,6 +3,7 @@
 {% block title %}{{ M_BLOG_NAME|e }}{% endblock %}
 
 {% block head_links %}
+  {{- super() -}}
   {% if articles_page and articles_page.has_previous() %}
   <link rel="prev" href="{{ articles_previous_page.url|format_siteurl|e }}" />
   {% endif %}
index 79a9f515ebfa37db790ba811ec24b1b81ffba595..b3023b5d5605217d6a4b65f98e6bf0501f7a3831 100644 (file)
@@ -3,6 +3,8 @@
 {% block title %}{{ article.title }} | {{ M_BLOG_NAME|e }}{% endblock %}
 
 {% block head_links %}
+  {{- super() -}}
+  {# don't mind me, I'm just fixing whitespace from the previous line #}
   <link rel="canonical" href="{{ article.url|format_siteurl|e }}" />
 {% endblock %}
 
index 89ee2b7d65ebbd41a519603f12d26b543c6e3af3..d41236df5e020f5318c4debd6843b78c31820fb8 100644 (file)
@@ -2,6 +2,14 @@
 {% if not M_BLOG_NAME %}{% set M_BLOG_NAME = SITENAME %}{% endif %}
 {% extends 'base.html' %}
 
+{% block head_links %}
+  {% if M_BLOG_FAVICON %}
+  <link rel="icon" href="{{ M_BLOG_FAVICON[0]|format_siteurl|e }}" type="{{ M_BLOG_FAVICON[1]|e }}" />
+  {% elif M_FAVICON %}
+  <link rel="icon" href="{{ M_FAVICON[0]|format_siteurl|e }}" type="{{ M_FAVICON[1]|e }}" />
+  {% endif %}
+{% endblock %}
+
 {% block social %}
   <meta property="og:site_name" content="{{ M_BLOG_NAME|e }}" />
 {% endblock %}
index f442aa86f2e0a1a7b9372611d5d17f71c2b69f9a..5d10e120459bb31be18c2744aa6020fe5b2ffc85 100644 (file)
@@ -1,6 +1,7 @@
 {% extends "base_blog.html" %}
 
 {% block head_links %}
+  {{- super() -}}
   {% if articles_page.has_previous() %}
   <link rel="prev" href="{{ articles_previous_page.url|format_siteurl|e }}" />
   {% endif %}
index 6a8f33d2a1eb4a12411d0d7b18ad013c5ca8aa47..70972616bdf0aca7ec5282500a75aa3e65d649da 100644 (file)
@@ -20,6 +20,9 @@
   <link rel="stylesheet" href="{{ style|expand_link(page)|e }}" />
   {% endfor %}
   {% endif %}
+  {% if M_FAVICON %}
+  <link rel="icon" href="{{ M_FAVICON[0]|format_siteurl|e }}" type="{{ M_FAVICON[1]|e }}" />
+  {% endif %}
   <link rel="canonical" href="{{ page.url|format_siteurl|e }}" />
 {% endblock %}
 
index d0854490132eb26d05e5607e975105c39c046e66..5cbdb2243982f1aa647cfa9cd77fd18254f74773 100644 (file)
@@ -5,6 +5,7 @@
   <title>A Pelican Blog</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon-blog.ico" type="image/x-icon" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="A Pelican Blog" />
   <meta property="og:title" content="A Pelican Blog" />
index b3a15b5315c1572dd16c66d44b751a9ce3bb538c..a9c164d1f5060acdc488b3e49861b736e5ebbce9 100644 (file)
@@ -5,6 +5,7 @@
   <title>An article — a jumbo one | A Pelican Blog</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon-blog.ico" type="image/x-icon" />
   <link rel="canonical" href="article-jumbo.html" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="A Pelican Blog" />
index 05fdad7c22ea412651b176e39ddf8ed0d03a82bc..7204624d34c639762658540c059f56d5125d7544 100644 (file)
@@ -5,6 +5,7 @@
   <title>An article | A Pelican Blog</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon-blog.ico" type="image/x-icon" />
   <link rel="canonical" href="article.html" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta name="description" content="Article description for the fake SEO believers." />
index cf4eade7133578bc5a237397154e37daaa19bf66..d1dc040cd81c47b9be3cb6aa8c9f7058a9b6492e 100644 (file)
@@ -5,6 +5,7 @@
   <title>Posts by Explicit Author | A Pelican Blog</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon-blog.ico" type="image/x-icon" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="A Pelican Blog" />
   <meta property="og:title" content="Explicit Author" />
index 4f1b0ec6ef619e418ff4df256b34dc1f4dacbb24..e356a0bb5c2987c1c55884a31689caf8f7528599 100644 (file)
@@ -5,6 +5,7 @@
   <title>Another category | A Pelican Blog</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon-blog.ico" type="image/x-icon" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="A Pelican Blog" />
   <meta property="og:title" content="Another category" />
index b804f4c80c85e8e1d9914b675e2d5a508a51735b..d9b7f998ecf300f6989b7cf9081e3cf661dc322b 100644 (file)
@@ -5,6 +5,7 @@
   <title>A Pelican Blog</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon-blog.ico" type="image/x-icon" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="A Pelican Blog" />
   <meta property="og:title" content="A Pelican Blog" />
index 9bc9d9092dcd10f9962810f2c845cf5764c45109..e904d2e6a23b2b8f46158aaa8790c48953dbce4c 100644 (file)
@@ -5,6 +5,7 @@
   <title>Posts tagged Third | A Pelican Blog</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon-blog.ico" type="image/x-icon" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="A Pelican Blog" />
   <meta property="og:title" content="Third" />
diff --git a/pelican-theme/test/blog_global_favicon/index.html b/pelican-theme/test/blog_global_favicon/index.html
new file mode 100644 (file)
index 0000000..6ce35c9
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>A Pelican Blog</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
+  <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.png" type="image/png" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <a href="./" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m">A Pelican Blog</a>
+    </div>
+  </div>
+</nav></header>
+<main>
+<div class="m-container">
+  <div class="m-row">
+    <div class="m-col-m-10">
+      <div class="m-note m-success">
+        <h3>Congratulations!</h3>
+        The m.css theme is alive and kicking! Now, feed it some articles so it doesn't feel so empty :)
+      </div>
+    </div>
+    <nav class="m-navpanel m-col-m-2">
+      <h3>Categories</h3>
+      <ol class="m-block-bar-m">
+        <li><em class="m-text m-dim">(none yet)</em></li>
+      </ol>
+    </nav>
+  </div>
+</div>
+</main>
+</body>
+</html>
index 1b2a5b10d85a38db914f89e22993e8193de9f4fc..b493f6d4296d3f619220adca798172454716c8bb 100644 (file)
@@ -5,6 +5,7 @@
   <title>&lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="next" href="index2.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index 77ceb109a7ab6a6efe709a55776152b411f5066c..1d96fcb43218afae2f1e35cbab4faa2d9dd0f0e7 100644 (file)
@@ -5,6 +5,7 @@
   <title>&lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="prev" href="index.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index c38788886c7a0144342d9c5d094bc6a8eae69e70..2da607567eab2a3d255b19c09c415da10d0ae65b 100644 (file)
@@ -5,6 +5,7 @@
   <title>Article with &lt;&amp;&gt; — a &lt;&amp;&gt; jumbo one | &lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="canonical" href="article-jumbo.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta name="description" content="And &lt;&amp;&gt; in description." />
index 27b0ad9ba9214c5e90e35214e747bf3c998ea135..918c0491256dd6203af2e965f0dc2efa1d6302eb 100644 (file)
@@ -5,6 +5,7 @@
   <title>Article with &lt;&amp;&gt; in title | &lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="canonical" href="article.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta name="description" content="And &lt;&amp;&gt; in description." />
index 17ae8145e4e1d824fca306c3c44a778444cb53ff..88a3d42333c7ff94d28091416aceb8b31f948e0b 100644 (file)
@@ -5,6 +5,7 @@
   <title>Posts by And &lt;&amp;&gt; in author | &lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="next" href="index2.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index d16ba4baea26fce3dffaa19eb3d51aadc519f0e2..170726ab714db76ba5fa3d49588215346e248229 100644 (file)
@@ -5,6 +5,7 @@
   <title>Posts by And &lt;&amp;&gt; in author | &lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="prev" href="index.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index 47cbaa92f4bd0743ba0480a53b15e7f2e6dbacd4..7ba9cd7b3762e517defe92f17c5a9a095e1130e5 100644 (file)
@@ -5,6 +5,7 @@
   <title>And &lt;&amp;&gt; in category | &lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="next" href="index2.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index ca83e2e9dfcf9cc7d36b2c4f6cee0414fa453ae7..f43c0bd2175b761784abdb823f800046086acb9e 100644 (file)
@@ -5,6 +5,7 @@
   <title>And &lt;&amp;&gt; in category | &lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="prev" href="index.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index aee21227d9ced4510421de0fc80bd4c000212bf8..3b24d2d38dd9306048284394a16cc8111bbdbd25 100644 (file)
@@ -5,6 +5,7 @@
   <title>&lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="next" href="index2.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index 4e96afbeef4e0debb5389a927f772f275c5ff330..fe22f10385293c15703e0c0a2ee7606b5512547f 100644 (file)
@@ -5,6 +5,7 @@
   <title>&lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="prev" href="index.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index cbc21ee97fcbad28db5601eed7e981ba195215e1..d2101e655f67c6cd5c0bda586665d16ea48a1a71 100644 (file)
@@ -5,6 +5,7 @@
   <title>Posts tagged And &lt;&amp;&gt; in tag | &lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="next" href="index2.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index d5e501dffcc7e8af55728053e33ec2eb531c3144..3f0cdb8b9a003738a7e800c5e1e99944c2a3f930 100644 (file)
@@ -5,6 +5,7 @@
   <title>Posts tagged And &lt;&amp;&gt; in tag | &lt;&amp;&gt; in blog name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="prev" href="index.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in blog name" />
index 59d39022e6dc097ba95101014a68665ff5694f29..e199ece5aba717b17ec7c95713d3ad0837f8c903 100644 (file)
@@ -5,6 +5,7 @@
   <title>Features | Your Brand</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico" type="image/x-icon" />
   <link rel="canonical" href="features.html" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="Your Brand" />
index 9e44328e563d00aefef75da9fa9cfb83cb875154..38ceca106757cd3048639bf19820d89b0add0919 100644 (file)
@@ -5,6 +5,7 @@
   <title>Guest post howto | Your Brand</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico" type="image/x-icon" />
   <link rel="canonical" href="guest-post-howto.html" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="Your Brand" />
index 009bf9e7fc9c696f6c5bb8c905b2f286b8b3923d..75681f18814ba2c0a7d0a9bb6b8aa908ad3ddfb9 100644 (file)
@@ -5,6 +5,7 @@
   <title>Your Brand Blog</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico" type="image/x-icon" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="Your Brand Blog" />
   <meta property="og:title" content="Your Brand Blog" />
index f4f2de6e1e7f315472af9c768b73605a6cd376f0..50bd555b9d74b55e860cf59bda1a65dce8aded05 100644 (file)
@@ -5,6 +5,7 @@
   <title>Showcase requirements | Your Brand</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico" type="image/x-icon" />
   <link rel="canonical" href="showcase-requirements.html" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="Your Brand" />
index 13246ef37d3faf550ffed61bb52c3b38d84080e8..8a2a7bc54817a77fbb40d181cda3fbef7ec0d4ff 100644 (file)
@@ -5,6 +5,7 @@
   <title>A &lt;&amp;&gt; blog</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="A &lt;&amp;&gt; blog" />
   <meta property="og:title" content="A &lt;&amp;&gt; blog" />
index 32fe8fc5ed1366dc2931661ca317398c83298edc..0c7b5f0448902747733853dc9ee0710af0f909b0 100644 (file)
@@ -5,6 +5,7 @@
   <title>And &lt;&amp;&gt; in breadcrumb &raquo; Page with &lt;&amp;&gt; in title | &lt;&amp;&gt; in site name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="canonical" href="breadcrumb.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in site name" />
index 56be11015c5e87c1bc08d36552f812c3d07ccfdd..c443735fb4cd337092d4d7b69a6319c74f35b783 100644 (file)
@@ -5,6 +5,7 @@
   <title>Escaping in content | &lt;&amp;&gt; in site name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="canonical" href="content.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in site name" />
index de2e384958f4649411f651c201be05136eb234cd..2cde6de55ebefffb9a3bd60949f7725129088400 100644 (file)
@@ -5,6 +5,7 @@
   <title>&lt;&amp;&gt; in site name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="canonical" href="landing.html?and&amp;in&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta property="og:site_name" content="&lt;&amp;&gt; in site name" />
index aec72cc5b04d2de99400a4cc0af17e7b043f1521..a69cf525cdc298e181da50d29b161cd5851a612b 100644 (file)
@@ -5,6 +5,7 @@
   <title>Page with &lt;&amp;&gt; in title | &lt;&amp;&gt; in site name</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
   <link rel="stylesheet" href="static/m-dark.css" />
+  <link rel="icon" href="favicon.ico?and&amp;in&amp;url=&#34;&#34;" type="huh&amp;what" />
   <link rel="canonical" href="page.html?and&amp;overriden&amp;url=&#34;&#34;" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <meta name="description" content="And &lt;&amp;&gt; in description." />
index c8270a597b1b56daa5440e76d3cba400345870ee..4fede2a821c029e2d67772d7624b66241b1250b1 100644 (file)
@@ -34,6 +34,8 @@ class Blog(BlogTestCase):
             'AUTHOR': "Implicit Author",
             'STATIC_PATHS': ['ship.jpg'],
             'M_BLOG_URL': 'archives.html',
+            'M_FAVICON': ('favicon.png', 'image/png'),
+            'M_BLOG_FAVICON': ('favicon-blog.ico', 'image/x-icon'),
             'FORMATTED_FIELDS': ['summary', 'description']
         })
 
@@ -447,6 +449,7 @@ class HtmlEscape(BlogTestCase):
             'SITENAME': '<&> in site name',
             'M_BLOG_NAME': '<&> in blog name',
             'M_BLOG_URL': 'archives.html?and&in&url=""',
+            'M_BLOG_FAVICON': ('favicon.ico?and&in&url=""', 'huh&what'),
             'ARTICLE_URL': '{slug}.html?and&in&url=""',
             'AUTHOR_URL': 'author-{slug}.html?and&in&url=""',
             'CATEGORY_URL': 'category-{slug}.html?and&in&url=""',
@@ -510,3 +513,15 @@ class ArchivedArticle(BlogTestCase):
 
         self.assertEqual(*self.actual_expected_contents('article.html'))
         self.assertEqual(*self.actual_expected_contents('article-jumbo.html'))
+
+class GlobalFavicon(BlogTestCase):
+    def __init__(self, *args, **kwargs):
+        super().__init__(__file__, 'global_favicon', *args, **kwargs)
+
+    def test(self):
+        self.run_pelican({
+            'M_FAVICON': ('favicon.png', 'image/png'),
+            'M_DISABLE_SOCIAL_META_TAGS': True
+        })
+
+        self.assertEqual(*self.actual_expected_contents('index.html'))
index 96822bdeed6ae63ac07a909e32d753ff2ba55cc1..a50c4f351ca5ba38423699593639abf626489de9 100644 (file)
@@ -35,6 +35,7 @@ class Layout(BaseTestCase):
             'SITENAME': 'Your Brand',
             'M_BLOG_NAME': 'Your Brand Blog',
             'M_SITE_LOGO_TEXT': 'Your.brand',
+            'M_FAVICON': ('favicon.ico', 'image/x-icon'),
             'M_LINKS_NAVBAR1': [
                 ('Features', 'features.html', 'features', []),
                 ('Showcase', '#', 'showcase', [
@@ -191,6 +192,7 @@ class HtmlEscape(BaseTestCase):
             'M_BLOG_NAME': 'A <&> blog',
             'M_SITE_LOGO': 'image.png?and&in&url=""',
             'M_SITE_LOGO_TEXT': '<&>',
+            'M_FAVICON': ('favicon.ico?and&in&url=""', 'huh&what'),
             'M_LINKS_NAVBAR1': [
                 ('An <&> item', 'item.html?and&in&url=""', '', [
                     ('A <&> subitem', 'sub.html?and&in&url=""', '')]),
index 57052666809b187adeb001b45f0c359bddd58950..381590a3ecf64a5285e8ff9857d3aaf3b375081c 100644 (file)
@@ -148,6 +148,7 @@ class HtmlEscape(PageTestCase):
             'PAGE_URL': '{slug}.html?and&in&url=""',
             # The social meta tags should be escaped properly as well
             'M_DISABLE_SOCIAL_META_TAGS': False,
+            'M_FAVICON': ('favicon.ico?and&in&url=""', 'huh&what')
         })
 
         # Verify that everything is properly escaped everywhere. The landing
@@ -166,6 +167,7 @@ class HtmlEscape(PageTestCase):
             'PAGE_URL': '{slug}.html?and&in&url=""',
             # The social meta tags should be escaped properly as well
             'M_DISABLE_SOCIAL_META_TAGS': False,
+            'M_FAVICON': ('favicon.ico?and&in&url=""', 'huh&what')
         })
 
         # Verify that also the Pelican-produced content has correctly escaped