簡體   English   中英

將Middleman FrontMatter變量傳遞給Helper標簽

[英]Passing Middleman FrontMatter variables into Helper Tags

我想通過這樣的方式從頁面傳遞一些YAML FrontMatter: <%= image_tag 'current_page.data.image_path' %>

我知道那是行不通的,因為它將它當作普通的舊字符串而不是變量來對待,但是我是Ruby和Middleman的新手,所以我不確定這樣做的正確方法。

只需刪除引號:

<%= image_tag current_page.data.image_path %>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM