collections/_drafts/jekyll-asset-url.rb
# Each method of the module creates a custom Jekyll filter
Each method of the module creates a custom Jekyll filter
Each method of the module creates a custom Jekyll filter
def asset_url(input)
    env = ENV['JEKYLL_ENV'] || 'development'
    is_development = env == 'development'
    asset_host = is_development ? 'http://dev-bucket.s3-website-us-east-1.amazonaws.com' : 'http://prod-bucket.s3-website-us-east-1.amazonaws.com'
    "#{asset_host}#{input}"
  end
def asset_url ( input ) env = ENV [ 'JEKYLL_ENV' ] || 'development' is_development = env == 'development' asset_host = is_development ? 'http://dev-bucket.s3-website-us-east-1.amazonaws.com' : 'http://prod-bucket.s3-website-us-east-1.amazonaws.com' "#{asset_host}#{input}" end
Each method of the module creates a custom Jekyll filter
Each method of the module creates a custom Jekyll filter
# asset_url filter business logic # Jekyll environment variable fallbacks to development # Check if environment is development # Set host variable # Return result URL string
input
<not_specific>