error when trying to use conf values in template

9 views
Skip to first unread message

Dave

unread,
Jul 22, 2016, 9:54:29 PM7/22/16
to nikola-discuss
I don't suppose anyone has any idea why config variables cannot be accessed / come across a similar issue before

For example


<p>&copy; 2016 ${site_url}</p>




results in

    context['self'].footer(**pageargs)
 
File "/home/me/nikola/test/site/cache/.mako.tmp/base_page.tmpl.py", line 282, in render_footer
    __M_writer
(str(site_url))
 
File "/home/me/nikola/test/py_3.5.0/lib/python3.5/site-packages/mako/runtime.py", line 226, in __str__
   
raise NameError("Undefined")
NameError: Undefined



I have checked the conf.py contains

SITE_URL = "https://domain.com"


So it isn't that, probably something I done wrong somewhere that isn't detected and this is the result.

Chris Warrick

unread,
Jul 23, 2016, 3:07:35 AM7/23/16
to Nikola—Discuss
On 23 July 2016 at 03:54, Dave <prosr...@gmail.com> wrote:
> I don't suppose anyone has any idea why config variables cannot be accessed
> / come across a similar issue before
>
> For example
>
>
> <p>&copy; 2016 ${site_url}</p>

[…]

> I have checked the conf.py contains
>
> SITE_URL = "https://domain.com"
>
>
> So it isn't that, probably something I done wrong somewhere that isn't
> detected and this is the result.

1. Not every config setting is available in templates.
2. Not every config setting is available under the same name in templates.

SITE_URL is ${blog_url} in templates.

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16
Reply all
Reply to author
Forward
0 new messages