@@ -308,8 +308,11 @@ def _toc(depth, toc_items):
308308
309309 book_toc = _toc (0 , parse_toc_nav (book ))
310310
311- data = {'book_items' : book_toc }
312- data .update (self .get_extra_body_data (book ))
311+ data = self ._get_data (book )
312+ data .update (self .get_extra_data (book ))
313+ data .update ({
314+ 'book_items' : book_toc
315+ })
313316
314317 if self .theme_name != '' :
315318 body_name = get_body (self .theme_name , self .name )
@@ -487,6 +490,11 @@ def _get_data(self, book):
487490 - Dictionary with default data for the templates
488491 """
489492
493+ show_header , show_footer = True , True
494+ if 'settings' in self .config :
495+ show_header = self .config ['settings' ].get ('show_header' , '' ) == 'on'
496+ show_footer = self .config ['settings' ].get ('show_footer' , '' ) == 'on'
497+
490498 return {
491499 "title" : get_refines (book .metadata , 'title-type' , 'main' ),
492500 "subtitle" : get_refines (book .metadata , 'title-type' , 'subtitle' ),
@@ -497,7 +505,10 @@ def _get_data(self, book):
497505 "isbn" : get_metadata (book .metadata , 'identifier' ),
498506 "language" : get_metadata (book .metadata , 'language' ),
499507
500- "metadata" : book .metadata
508+ "metadata" : book .metadata ,
509+
510+ "show_header" : show_header ,
511+ "show_footer" : show_footer
501512 }
502513
503514 def _create_frontmatter (self , book ):
0 commit comments