Re: [nikola-discuss] AttributeError: 'Undefined' object has no attribute 'meta'

2020-05-22 Thread moi
Thanks ! It works just fine. But did the banner appears to you ? 
I modified the global context in the conf.py but it doesn't seem to work for 
me. 
I surely checked the google discuss about the same problem... 

Le 21 mai 2020 à 11:14, Roberto Alsina a écrit :

> I got the zip you sent me.
> 
> * I moved aside the copy of canterville you included and downloaded the 
> original
> * Re-added as empty the galleries you removed before sending
> 
> And it built just fine.
> 
> * Put back your version of canterville:
> 
> [2020-05-21 06:12:17] ERROR: Nikola: File 
> "/home/ralsina/Downloads/x/nikola_test/cache/.mako.tmp/base.tmpl.py", line 88
> else:
> ^
> SyntaxError: invalid syntax
> 
> So, the problem seems to either have been fixed in canterville after you 
> installed it, or was introduced when you edited it.
> 
> These are the relevant differences:
> 
> -% if 'main_index' in pagekind and BANNER_URL:
> +% if 'main_index' in pagekind and BANNER_URL :
>  
> -% else:
> +% elif 'post_page' in pagekind and post.meta('banner'):
>  
>  % else:
>  
> 
> You can just get the original base.tmpl from canterville and replace yours 
> and it will probably build just fine:
> 
> https://github.com/getnikola/nikola-themes/blob/master/v8/canterville/templates/base.tmpl
> 
> 
> On Wed, May 13, 2020 at 8:08 AM Roberto Alsina  wrote:
> On Wed, May 13, 2020 at 7:30 AM Julien Vallet  wrote:
> Can I send you the context ? What would you need ? I'm just at the end of the 
> rope
> 
> 
> Is your site's source code somewhere I can see it?
> 
> Or just make a zip and email it to me.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to nikola-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/nikola-discuss/CALXDAfr94HgQKHVQPF%3D4SZGutGX0mirJ-jyYyM6L81K1Eka_%3Dg%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nikola-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nikola-discuss/4C0750E3-9FC3-43D2-BFF8-E5078ADC64F3%40wanadoo.fr.


[nikola-discuss] Re: AttributeError: 'Undefined' object has no attribute 'meta'

2020-05-22 Thread Julien Vallet
Yet my output does not compile it, there is just the logo and the menu, and 
the header is "post-head no-cover". 

Le mercredi 13 mai 2020 10:59:50 UTC+2, Julien Vallet a écrit :
>
> Hi,
>
>
> I have trouble with the replacement of an old theme.
>
> When building under a new theme (canterville), I get a 
>
>
> __M_writer(str(post.meta('banner')))
> AttributeError: 'Undefined' object has no attribute 'meta'
>
> 
> render_galleries:output/galleries/index.html :
>  
>
> Maybe its because I misused conf.py ?
>
>
> GLOBAL_CONTEXT = {
>"BANNER_URL": '/assets/img/oeil.jpg',
>
> }
>
>
> Yet I've been careful with the Global_context location...
>
>
> Or in my template ?
>
>
> 
> % if 'main_index' in pagekind:
> 
> % else:
> 
> % else:
> 
> % endif
>  
>
> Can you help me ? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nikola-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nikola-discuss/a5a03637-448e-4923-8ded-948034f88c80%40googlegroups.com.


Re: [nikola-discuss] Re: AttributeError: 'Undefined' object has no attribute 'meta'

2020-05-22 Thread Roberto Alsina
I did not check anything other than that it built.

On Fri, May 22, 2020 at 5:26 AM Julien Vallet  wrote:

> It worked just fine thanks ! I had changed the base.tmpl trying to impose
> the banner.
> Now the site works well, but I'm still in struggle with the metadata, yet
> I think I have set the global context at the right place and tried numerous
> possibilities to set the pagekind to main_index and BANNER_URL.
> Did the banner opened when you build it ?
>
>
> Le mercredi 13 mai 2020 10:59:50 UTC+2, Julien Vallet a écrit :
>>
>> Hi,
>>
>>
>> I have trouble with the replacement of an old theme.
>>
>> When building under a new theme (canterville), I get a
>>
>>
>> __M_writer(str(post.meta('banner')))
>> AttributeError: 'Undefined' object has no attribute 'meta'
>>
>> 
>> render_galleries:output/galleries/index.html :
>>
>>
>> Maybe its because I misused conf.py ?
>>
>>
>> GLOBAL_CONTEXT = {
>>"BANNER_URL": '/assets/img/oeil.jpg',
>>
>> }
>>
>>
>> Yet I've been careful with the Global_context location...
>>
>>
>> Or in my template ?
>>
>>
>> 
>> % if 'main_index' in pagekind:
>> 
>> % else:
>> 
>> % else:
>> 
>> % endif
>>
>>
>> Can you help me ?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nikola-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nikola-discuss/30d378ed-0a7d-4752-ba9c-b9f1cafefdb4%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nikola-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nikola-discuss/CALXDAfqJv-ED3Rs7%3DtEt-_HZ-%2Bv9jTGhtLEBiU-jMWdpPpbFrg%40mail.gmail.com.


[nikola-discuss] Re: AttributeError: 'Undefined' object has no attribute 'meta'

2020-05-22 Thread Julien Vallet
It worked just fine thanks ! I had changed the base.tmpl trying to impose 
the banner.
Now the site works well, but I'm still in struggle with the metadata, yet I 
think I have set the global context at the right place and tried numerous 
possibilities to set the pagekind to main_index and BANNER_URL.
Did the banner opened when you build it ?


Le mercredi 13 mai 2020 10:59:50 UTC+2, Julien Vallet a écrit :
>
> Hi,
>
>
> I have trouble with the replacement of an old theme.
>
> When building under a new theme (canterville), I get a 
>
>
> __M_writer(str(post.meta('banner')))
> AttributeError: 'Undefined' object has no attribute 'meta'
>
> 
> render_galleries:output/galleries/index.html :
>  
>
> Maybe its because I misused conf.py ?
>
>
> GLOBAL_CONTEXT = {
>"BANNER_URL": '/assets/img/oeil.jpg',
>
> }
>
>
> Yet I've been careful with the Global_context location...
>
>
> Or in my template ?
>
>
> 
> % if 'main_index' in pagekind:
> 
> % else:
> 
> % else:
> 
> % endif
>  
>
> Can you help me ? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nikola-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nikola-discuss/30d378ed-0a7d-4752-ba9c-b9f1cafefdb4%40googlegroups.com.