File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,6 +128,17 @@ def convert_notebooks(selected_nb_re=None):
128128 app .notebooks = [os .path .join (path ,filename )]
129129 app .start ()
130130
131+ # HACK to set title and other things in rendered notebook
132+ html_filename = "{}.html" .format (os .path .join (html_base ,cleanbase ))
133+ with open (html_filename , 'rb' ) as f :
134+ html_file_data = f .read ()
135+
136+ with open (html_filename , 'wb' ) as f :
137+ html_file_data = html_file_data .decode ("utf-8" )
138+ html_file_data = html_file_data .replace ("{title}" ,
139+ nb ['metadata' ]['astropy-tutorials' ]['link_name' ])
140+ f .write (html_file_data .encode ("utf8" ))
141+
131142 index_listing = dict ()
132143 index_listing ["link_path" ] = "{}.html" .format (cleanbase )
133144 index_listing ["link_name" ] = nb ['metadata' ]['astropy-tutorials' ]['link_name' ]
Original file line number Diff line number Diff line change 33{% block header %}
44<meta name= " viewport" content= " width=device-width, initial-scale=1" />
55
6- <title></title>
6+ <title>{title} </title>
77
88{{ super() }}
99
You can’t perform that action at this time.
0 commit comments