Created a tornado template template.html
like so:
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{% set base = '.' %}
<link rel="stylesheet" href="style.scss" />
</head>
And in my gramex.yaml
I have
url:
endpoint:
pattern: /$YAMLURL/tmpl/?([^/]*)?/?([0-9]+)?
handler: FileHandler
kwargs:
path: $YAMLPATH/template.html
template: true
Now running gramex and trying to access the page.
when I access http://localhost:9988/tmpl
, IT works fine and the SCSS
is linked.
However accessing http://localhost:9988/tmpl/1
or http://localhost:9988/tmpl/1/1
tries to get the SCSS
from .../tmp/style.scss
and .../tmp/1/style.scss
respectivelly.
I am sure that I am missing something very small.
Any help will be greatly appreciated.
PS - One solution is to use absolute paths like
<link rel="stylesheet" href="/style.scss" />
However, that is not preferable.