GNU Artanis provides special helper commands.
Please notice that GNU Artanis constrains the path of sources in the application directory for security reasons. The resources files, CSS, JS etc, should be put int pub directory in the application directory, or the client won’t be able to access them.
These special commands are useful to expand the path for you, and they should be added into the tamplate file, for example:
<html> <head> <@icon favicon.ico %> <@js functions.js %> <@css blog.css %> </head> <@include sidebar.html %> <body> ... </body> </html>
NOTE: The command name is prefixed with @, as, @include, @css, etc. Please do not seperate the @, or it will throw exception.
You can include html files with the include command:
;; @include is the command name, not <@ include filename %> <@include filename.html %>
This will be expanded like this:
/current_toplevel/pub/filename.html
NOTE: Please make sure the included file is in the pub directory in the application directory.
To refer to a CSS file:
<@css filename.css %>
This will be expanded like this:
<link rel="stylesheet" href="/css/filename.css">
To refer to a JS (javascript) file in the HTML head:
<@js filename.js %>
This will be expanded like this:
<script type="text/javascript" src="/js/filename.js"> </script>
To specify an icon for the domain:
<@icon favicon.ico %>
This will be expanded like this:
<link rel="icon" href="/img/favicon.ico" type="image/x-icon">