How to include CSS file in Hippo CMS?

660 views Asked by At

I'm using HippoCMS 10. I did "Hello World" tutorial from official site. Now I want to include CSS file and style something. I did this:

<html>
    <head>
        <link rel="stylesheet" href="<@hst.webfile path='/css/screen.css' />" type="text/css"/>
    </head>
    <body>
        <h1>Hello World </h1>
    </body>        
</html>

But when I try to open the page (http://localhost:8080/site/) I'm getting this error:

[INFO] [talledLocalContainer] Java stack trace (for programmers):
[INFO] [talledLocalContainer] FTL stack trace ("~" means nesting-related):
[INFO] [talledLocalContainer]   - Failed at: @hst.webfile path="/css/screen.css"
  [in template "webfile:/freemarker/kkbp/homepage-main.ftl" at line 3, column 38
]
[INFO] [talledLocalContainer] ----
[INFO] [talledLocalContainer] ----
[INFO] [talledLocalContainer] freemarker.core.InvalidReferenceException: [... Ex
ception message was already printed; see it above ...]
[INFO] [talledLocalContainer]   at freemarker.core.InvalidReferenceException.get
Instance(InvalidReferenceException.java:116)
[INFO] [talledLocalContainer]   at freemarker.core.UnexpectedTypeException.newDe
sciptionBuilder(UnexpectedTypeException.java:60)
[INFO] [talledLocalContainer]   at freemarker.core.UnexpectedTypeException.<init

I can't handle what's the problem. In every example I found was exactly the same things I did. Location of CSS file i

..\bootstrap\webfiles\src\main\resources\site\css\screen.css
1

There are 1 answers

2
Astrowie On BEST ANSWER

Adding these lines to your code might solve the problem.

<!doctype html>
<#include "../include/imports.ftl">

Edit: The easiest way to get to your error logs is to get them from here: target\tomcat8x\logs\hippo-site.log