From 709b090e5be55d2b831aab4ab6cfce229ca4d21b Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 7 Jun 2012 14:27:03 -0500 Subject: [PATCH] Better method for customizing the favicon. Closes #594 --- .themes/classic/source/_includes/custom/head.html | 10 +++++++--- .themes/classic/source/_includes/head.html | 3 ++- .../source/{favicon.png => octopress-favicon.png} | Bin Rakefile | 1 - 4 files changed, 9 insertions(+), 5 deletions(-) rename .themes/classic/source/{favicon.png => octopress-favicon.png} (100%) diff --git a/.themes/classic/source/_includes/custom/head.html b/.themes/classic/source/_includes/custom/head.html index 85879f4..5adcf08 100644 --- a/.themes/classic/source/_includes/custom/head.html +++ b/.themes/classic/source/_includes/custom/head.html @@ -1,3 +1,7 @@ - - - +{% comment %} +To customize the favicon, assign it to "/url/to/favicon.png" +{% endcomment %} +{% assign favicon = false %} + + + diff --git a/.themes/classic/source/_includes/head.html b/.themes/classic/source/_includes/head.html index 41b70f6..9482d18 100644 --- a/.themes/classic/source/_includes/head.html +++ b/.themes/classic/source/_includes/head.html @@ -19,7 +19,6 @@ {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %} - @@ -27,4 +26,6 @@ {% include custom/head.html %} {% include google_analytics.html %} + {% unless favicon %}{% capture favicon %}{{ root_url }}/octopress-favicon.png{% endcapture %} {% endunless %} + diff --git a/.themes/classic/source/favicon.png b/.themes/classic/source/octopress-favicon.png similarity index 100% rename from .themes/classic/source/favicon.png rename to .themes/classic/source/octopress-favicon.png diff --git a/Rakefile b/Rakefile index ee5d44d..6afe957 100644 --- a/Rakefile +++ b/Rakefile @@ -231,7 +231,6 @@ task :update_source, :theme do |t, args| puts "## Copied #{source_dir} into #{source_dir}.old/" cp_r "#{themes_dir}/"+theme+"/source/.", source_dir, :remove_destination=>true cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/", :remove_destination=>true - cp "#{source_dir}.old/favicon.png", source_dir mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir && File.exists?("#{source_dir}.old/index.html") if File.exists?("#{source_dir}/blog/archives/index.html")