0

How to specify a custom stylesheet (external) to a SSP template (Scala Server Pages) in Scalate?

I tried specifying the html linking in the default.ssp file as follows.

<html>
   <head>
      <link rel="stylesheet" type="text/css" href="css/style.css"/>
   </head>
   <body>
        <%= unescape(body) %>
   </body>
</html>

However the stylesheet is not served by Scalatra (Jetty Web Server). I tried inserting the script through <%@include .. as well. Still no luck.

The web page is served without any stylesheet!

itsraghz
  • 857
  • 1
  • 11
  • 25

1 Answers1

0

You need to have the style.css file as follows.

cd <YourProjectRoot>/src/main/webapp/
mkdir css
touch style.css

Create a style.css file inside a directory css which should be within the webapp directory, for the Scalatra to find out and serve the resource (stylesheet) appropriately.

Note: The folder should be named as css however the file can be named as anything.

itsraghz
  • 857
  • 1
  • 11
  • 25