Describe the bug
I am trying to use recent template rework for overwriting ablog/postcard.html only but keep the rest of Ablog templates. However, I can't find out the way to manage it. Is there some known theme which ships their Ablog templates? Maybe it would help me.
To Reproduce
However, I suspect that this template rework is broken.
- Because I want to "hide" only some Ablog templates, I don't set
skip_injecting_base_ablog_templates = True.
- Under my theme folder, I created
ablog/postcard.html
- In my
theme.toml I added
[ablog]
inject_templates_after_theme = true
- My theme's
ablog/postcard.html is never used.
There is at least one reason why not. Consider the relevant excerpt from Ablog:
try:
after_theme = theme.get_config("ablog", "inject_templates_after_theme", False)
except ThemeError:
after_theme = False
if after_theme:
loaders.append(SphinxFileSystemLoader(get_html_templates_path()))
else:
loaders.insert(templatepathlen, SphinxFileSystemLoader(get_html_templates_path()))
The theme.get_config("ablog", "inject_templates_after_theme", False) call raises ThemeError exception with message Theme configuration sections other than [theme] and [options] are not supported.
This exception is incorrectly interpreted as missing default value and code flow went to else block.
But as the message said, the Sphinx's Theme.get_config() doesn't allow reading custom sections like [ablog] from theme.toml files. Unfortunately in such case, it raises ThemeError too.
(Excerpt from Theme.get_config():)
msg = __(
'Theme configuration sections other than [theme] and [options] '
'are not supported (tried to get a value from %r).'
)
raise ThemeError(msg)
Screenshots
No response
System Details
Sphinx==8.1.2
ablog==0.11.11
Installation method
No response
Describe the bug
I am trying to use recent template rework for overwriting
ablog/postcard.htmlonly but keep the rest of Ablog templates. However, I can't find out the way to manage it. Is there some known theme which ships their Ablog templates? Maybe it would help me.To Reproduce
However, I suspect that this template rework is broken.
skip_injecting_base_ablog_templates = True.ablog/postcard.htmltheme.tomlI addedablog/postcard.htmlis never used.There is at least one reason why not. Consider the relevant excerpt from Ablog:
The
theme.get_config("ablog", "inject_templates_after_theme", False)call raisesThemeErrorexception with messageTheme configuration sections other than [theme] and [options] are not supported.This exception is incorrectly interpreted as missing default value and code flow went to
elseblock.But as the message said, the Sphinx's
Theme.get_config()doesn't allow reading custom sections like[ablog]fromtheme.tomlfiles. Unfortunately in such case, it raises ThemeError too.(Excerpt from
Theme.get_config():)Screenshots
No response
System Details
Sphinx==8.1.2
ablog==0.11.11
Installation method
No response