-
I'm trying to do an RST include in a page, where I want to pull in a .. raw:: html
:file: theme/mytheme/templates/include/social.html The problem I'm having is that the parser can't find the HTML file. Neither the documentation sections on linking to static files nor including content in RST or Markdown files mention what the CWD should be, or how (or if) you can include template files. Can someone enlighten me? Or is there a better approach to doing this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Aha! Probably should have continued with the trial-and-error for longer... found that it's in the However, it looks like this include happens outside whatever part of Pelican does jinja template processing, because that part of the include file is just treated as raw text, regardless of whether I use So hopefully someone can suggest a better approach for getting templated data into a Page. |
Beta Was this translation helpful? Give feedback.
-
Hello I was thinking to execute a python script gathering data and feeding it in a Jinja template, copied at the right place for Pelican to upload it with the html generated content. That what I would suggest: generating the entire page with your data in rst and copying it in |
Beta Was this translation helpful? Give feedback.
-
After a bit more poking, I think I have found The Way This is Supposed to Be Done: The documentation as-written leads to some uncertainty about how to set this up though, and the default configuration leads to some misleading errors... so here's what I ended up doing to make this work:
|
Beta Was this translation helpful? Give feedback.
After a bit more poking, I think I have found The Way This is Supposed to Be Done:
TEMPLATE_PAGES
.The documentation as-written leads to some uncertainty about how to set this up though, and the default configuration leads to some misleading errors... so here's what I ended up doing to make this work:
Make sure that both
ARTICLE_PATHS
andPAGE_PATHS
are set to search a directory underPATH
, and are not empty variables.If either are left blank then Pelican will find the not-RST-nor-MD files referenced by
TEMPLATE_PAGES
and there will be errors about missing document headers (liketitle
). By default,PAGE_PATHS
is set butARTICLE_PATHS
is empty. For example: