Is it possible to use Cassette or SquishIt in NancyFx when using Super Simple View Engine?

As i understand it SSVE does not have a way to place a bundle in its output. SSVE only provides simple conditional logic and regex output of the model properties

I'm partial to the style of SSVE and would rather use that over Razor if it's possible to do bundles and minification of CSS, Less and JavaScript, CoffeeScript.

有帮助吗?

解决方案

SSVE is a regex based view engine. If you look at the examples for Cassette or Squishit you see code such as:

@{
  Bundles.Reference("content");
  Bundles.Reference("scripts/app/page.js");
}
<!DOCTYPE html>
<html>
<head>
  <title>Web App</title>
  @Bundles.RenderStylesheets()
</head>
<body>
  ...
  @Bundles.RenderScripts()
</body>
</html>

SSVE does not execute code blocks as such it has no method to execute the @Bundles.RenderStylesheets()

I was able to get around this be adding the output, in my case from Squishit to the ViewBag using the NancyFx pipeline.

Here is a blog post with screenshots: http://eric.polerecky.com/css-and-javascript-bundles-super-simple-view-engine/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top