You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to Nikola and have been simultaneously trying to follow both the Creating a Site (Not a Blog) guide as well as the Creating a Theme guide. I want to be able to override the page_header template hook specifically on my index page, within my custom theme, but am running into a lot of trouble. I based my theme off the default Mako one, per the guide.
The first thing I did was copy the index.tmpl file using nikola theme -c index.tmpl. Then I tried adding the following block definition to it:
<%block name="page_header">
${parent.page_header()}
Test content
</%block>
However, my test content string doesn't show up anywhere when I run nikola build. Is there something I'm missing?
The text was updated successfully, but these errors were encountered:
Template hooks are usable only from within plugins. There is a template block for the header, but it’s named extra_header, not page_header.
Also, note that index.tmpl affects blog indexes, it won’t change the index page if you’re going that route. For that, you would need to apply a special template via the PAGES config setting, or override page.tmpl and check if the post variable is the index page.
Environment
Python Version: 3.10.7
Nikola Version: 8.2.4
Operating System: Windows 11
Description
I'm new to Nikola and have been simultaneously trying to follow both the Creating a Site (Not a Blog) guide as well as the Creating a Theme guide. I want to be able to override the
page_header
template hook specifically on my index page, within my custom theme, but am running into a lot of trouble. I based my theme off the default Mako one, per the guide.The first thing I did was copy the index.tmpl file using
nikola theme -c index.tmpl
. Then I tried adding the following block definition to it:However, my test content string doesn't show up anywhere when I run
nikola build
. Is there something I'm missing?The text was updated successfully, but these errors were encountered: