Search code examples
.netnhaml

add output of %link directive to variable?


In my master a partial _styles is loaded. In this _styles there is a ^var styles = "" Now in all my views or partials I can say var styles = styles+"another style"

Normally a style is defined as

%link{ href="../../content/css/partial.css" rel="stylesheet" type="text/css" }

How can I append the output of the %link directive to the styles variable?


Solution

  • I wrote a post about adding styles and links with the NHAML.
    This should do all job for you.