You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sphinx-users
Any suggestions for how to add a custom template for the first/top page (index.html) for html output?
It looks like by default, Sphinx uses page.html (which in turn references layout.html), but it's not clear to me how to customize just one page (in this case the "home" page).
I've got html_additional_pages = {'index': 'index.html'} and html_theme_path is set to a local folder with my index.html template; however, my index.html template never seems to be used. BTW my custom layout.html template file in the same folder IS being used for all the pages, so I know Sphinx is at least finding my files.
Thanks!
Komiya Takeshi
unread,
May 21, 2020, 11:57:40 AM5/21/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sphinx...@googlegroups.com
Hi,
Unfortunately, there is no proper way to switch HTML templates only
for a specific page. In Sphinx doc, we use `html_additional_pages` to
copy static index.html, and change master_doc to "contents.rst" not to
conflict with static file.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sphinx...@googlegroups.com
Hello Ken and Komia,
a little bit late to the party... I use exactly what you want to achieve on my recently launched blog https://blog.documatt.com (it's regular Sphinx project). Front page (index.rst) uses index.html template thanks to
html_additional_pages={'index':'index.html',}
The rest of the blog uses layout.html. I've just created a repo showing it. It includes output index.html under _build/html/.