Compiling a template that includes other templates

68 views
Skip to first unread message

Denis Kalinin

unread,
Mar 17, 2016, 2:22:24 PM3/17/16
to Scalate
Hi!

I'm trying to use Scalate (SSP) for building a custom static site generator. My template looks like this:

<% include("header.ssp") %>

<% include("menu.ssp") %>

<% include("page.ssp") %>

<% include("footer.ssp") %>

Documentation says it's OK to use "include". Nevertheless, when I try to compile it, I see the following error:

Generating...
Exception in thread "main" org.fusesource.scalate.CompilerException: Compilation failed:
[20:55:17.314] [ERROR] TemplateEngine - Compilation failed:
templates/post.ssp:7.4 error: not found: value include
/tmp/scalate-1455351618183414059-workdir/src/templates/post.ssp.scala:14: error: not found: value include
<% include("footer.ssp") %>
             include("header.ssp")

What I find particularly strange is the fact that it complains about "include", which is supposed to be a built-in function. Am I missing something? My code is:

val sspEngine = new TemplateEngine()

val output = sspEngine.layout("templates/post.ssp")

 
Reply all
Reply to author
Forward
0 new messages