我有view.haml
和partial.haml
我想要处理的是,在view.haml
中声明一个变量,但在渲染后将其打印在partial.haml
中,我不使用rails或synatra或aany框架,这只是haml
,我该怎么做?
view.haml代码:
- test = 'Hello world'
!!! 5
%html{:lang => "es"}
%head
%body
/ Breadcrumbs
= Haml::Engine.new(File.read(File.expand_path 'src/views/components/breadcrumbs.haml', File.dirname(__FILE__))).render
partial.haml
%section.Breadcrumbs
%h2.Breadcrumbs-title Title
%ul.Breadcrumbs-links
%li
%a{:href => "#"}
#{test}
%li
%a{:href => "#"} Bread 2
%li.active Bread 3