我使用的是中间人和Slim模板。
我代理数据自动创建多个页面。我需要用变量来设置YAML的前端事件,但我不知道该怎么做!有人知道吗?
例如。
在config.rb中
data.videos.expert_challenge_videos.each do |v|
proxy "/live/expertchallenge/#{v.slug}.html", "/live/expertchallenge/template.html", :locals => { :v => v }, :ignore => true
end在template.html.slim中
---
title: Expert Challenge - #{v.name}
---
.live-single-video
== partial 'header'
.spacer
.grid-container
.grid-100.heading
== image_tag "label-expertchallenge.png", alt: ''
.grid-container
.grid-100.video-container
iframe src="http://area.autodesk.com/areaadmin/ooyala/show/ZobHQ4NzrsYP4CNnu2EijUGDRztihF7j/1000/562" width="1000" height="562" frameborder="0" webkitAllowFullScreen="webkitAllowFullScreen" mozallowfullscreen="mozallowfullscreen" allowFullScreen="allowFullScreen"
.grid-container
.grid-50.video-description
.name
| <b>Name:</b> #{v.name}
.date
| <b>Date:</b> #{v.date}
.topics
| <b>Topics:</b> #{v.topics}
.grid-50.video-share
| <div class="fb-like" data-send="false" data-layout="button_count" data-width="200" data-show-faces="false" data-href="#{endpoint}/live/expertchallenge/#{v.slug}.html"></div>
| <a href="https://twitter.com/share" class="twitter-share-button" data-url="#{endpoint}/live/expertchallenge/#{v.slug}.html" data-via="Autodesk_ME" data-text="#{v.name}">Tweet</a>
== partial 'footer'发布于 2013-11-21 00:30:46
在您的config.rb中添加以下行:
set :frontmatter_extensions, %w(.html .slim)这应该能起到作用。
https://stackoverflow.com/questions/15815742
复制相似问题