2014-07-05 24 views
0

我嘗試使用Volt標籤助手(如stylesheet_link)鏈接到沒有協議前綴的外部URL。沒有協議無協議的外部URL上的標籤助手

實施例的使用被證明是無問題:

{{ stylesheet_link('http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css') }} 

生成

<link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" /> 

然而,每當協議前綴obmitted(即/ //netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css):

{{ stylesheet_link('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css') }} 

生成不正確的URL:

<link rel="stylesheet" type="text/css" href="[SITE_PREFIX]//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" /> 

是不是由於我的不正確使用?或者這是一個伏特現有的錯誤?

回答

2

嘗試指定它不是本地的,see the docs

{{ stylesheet_link('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css', false) }}