From d8fdc0dd20bf6abe16e72f377fb9f501f3b97efc Mon Sep 17 00:00:00 2001 From: yafeilee Date: Sat, 6 Aug 2016 02:29:42 +0800 Subject: [PATCH] Add cdn --- config/application.yml.example | 3 +++ config/environments/production.rb | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config/application.yml.example b/config/application.yml.example index 2f41ea9..d770379 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -29,6 +29,9 @@ SITE_YEAR: '© 2012 - 2016' # google analytics, blank it if you don't need GOOGLE: '' +# CDN ( optional ) +CDN: '' + # Email Setting, see more: /config/environments/production.rb MAIL_SERVER: '' DOMAIN_NAME: '' diff --git a/config/environments/production.rb b/config/environments/production.rb index 06253c5..79c4bbe 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -55,7 +55,9 @@ WBlog::Application.configure do # config.cache_store = :mem_cache_store # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = "http://assets.example.com" + if ENV['CDN'].present? + config.action_controller.asset_host = ENV['CDN'] + end # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.