Re: [nikola-discuss] Re: Using custom template for the index page of a static site

2019-08-17 Thread Roberto Alsina
Has happened to most of us :-)

On Sat, Aug 17, 2019 at 7:23 AM Tsvetomir Dimitrov 
wrote:

> The result of "ask stupid question on the internet to find the answer 10
> minutes later"
>
> The template behavior is exactly as I expected it, however I've messed up
> my conf.py file and newly generated pages were in pages subdir. Because I
> haven't cleaned the old index was still in the site root and looked like my
> template is totally ignored.
>
>
> On Saturday, 17 August 2019 12:18:14 UTC+3, Tsvetomir Dimitrov wrote:
>>
>> Hello everyone!
>>
>> I'm using Nikola for a personal blog and I want to create a custom index
>> page. I managed to that following the handbook instructions but now I want
>> to go a step further - to modify the mako template, used to render the
>> index page. I'm stuck at this step.
>>
>> Here is what I do (based on this tutorial:
>> https://getnikola.com/creating-a-custom-page.html):
>>
>> I've got an index page and I modify its metadata as mentioned in the link
>> above
>>
>> .. title: my homepage
>> .. slug: index
>> .. date: 2019-08-13 23:16:14 UTC+03:00
>> .. tags:
>> .. category:
>> .. link:
>> .. description:
>> .. type: text
>> .. hidetitle: True
>> .. template: front.tmpl
>>
>>
>>
>> Then in front.tmpl I add this:
>>
>> ## -*- coding: utf-8 -*-
>> <%namespace name="helper" file="post_helper.tmpl"/>
>> <%namespace name="pheader" file="post_header.tmpl"/>
>> <%inherit file="post.tmpl"/>
>>
>> ## This redefines the extra_head block which goes at the end of 
>> <%block name="extra_head">
>> ${parent.extra_head()}
>> 
>> 
>>
>> <%block name="content">
>>  Nothing in here... Literally nothing
>> 
>>
>>
>> My expectations are that bootstrap-social.css will appear in the head
>> section of the generated text, but it didn't happen.
>>
>> To validate that my template is working I inherited the content block and
>> replaced it with static text. My expectation was that it will override the
>> contents of the RST file, but again it didn't happen.
>>
>> Overall it seems that my template is not used at all. Could you please
>> give me some hints what I'm doing wrong?
>>
> --
> 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/a6a9e2a0-f047-4ff8-95f5-bebe49f167bf%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/CALXDAfo%3DNwxntv4HVpuQdkKKb%2BvE87QDrfvt8jhMjBdBb51rAg%40mail.gmail.com.


[nikola-discuss] Re: Using custom template for the index page of a static site

2019-08-17 Thread Tsvetomir Dimitrov
The result of "ask stupid question on the internet to find the answer 10 
minutes later"

The template behavior is exactly as I expected it, however I've messed up 
my conf.py file and newly generated pages were in pages subdir. Because I 
haven't cleaned the old index was still in the site root and looked like my 
template is totally ignored.


On Saturday, 17 August 2019 12:18:14 UTC+3, Tsvetomir Dimitrov wrote:
>
> Hello everyone!
>
> I'm using Nikola for a personal blog and I want to create a custom index 
> page. I managed to that following the handbook instructions but now I want 
> to go a step further - to modify the mako template, used to render the 
> index page. I'm stuck at this step.
>
> Here is what I do (based on this tutorial: 
> https://getnikola.com/creating-a-custom-page.html):
>
> I've got an index page and I modify its metadata as mentioned in the link 
> above
>
> .. title: my homepage
> .. slug: index
> .. date: 2019-08-13 23:16:14 UTC+03:00
> .. tags: 
> .. category: 
> .. link: 
> .. description: 
> .. type: text
> .. hidetitle: True
> .. template: front.tmpl
>
>
>
> Then in front.tmpl I add this:
>
> ## -*- coding: utf-8 -*-
> <%namespace name="helper" file="post_helper.tmpl"/>
> <%namespace name="pheader" file="post_header.tmpl"/>
> <%inherit file="post.tmpl"/>
>
> ## This redefines the extra_head block which goes at the end of 
> <%block name="extra_head">
> ${parent.extra_head()}
> 
> 
>
> <%block name="content">
>  Nothing in here... Literally nothing
> 
>
>
> My expectations are that bootstrap-social.css will appear in the head 
> section of the generated text, but it didn't happen.
>  
> To validate that my template is working I inherited the content block and 
> replaced it with static text. My expectation was that it will override the 
> contents of the RST file, but again it didn't happen.
>
> Overall it seems that my template is not used at all. Could you please 
> give me some hints what I'm doing wrong?
>

-- 
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/a6a9e2a0-f047-4ff8-95f5-bebe49f167bf%40googlegroups.com.