Change theme by page/section

I would like to be able to change the theme of a page or section by adding the theme to the metadata of the page:

theme = "theme-name"

I don’t think we can do something like this. Is this a possible feature?

1 Like

you mean set a theme for one page/section out of several other pages/sections?

a theme is for the entire site.

nevertheless its not a bad idea given the possibility of hosting different authors such as that offered by ‘medium.com

Exactly, yes. The ability to have a section of the website, or a page, use a theme. To be able to easily switch away from the site’s main theme, without having to make your own template file if the theme you need already exists.

For example, if you have a website with a landing page that uses it’s own template, and most pages on it use a certain theme. But then you launch a new product and there is another theme that’s good for that product.

Another example is a person website with a blog using a standard blog theme, but you want to throw up some documentation you wrote but use a documentation theme for it.

I had not considered different authors. That is another excellent example for a group of people publishing to the same site.

So basically: the ability to over-ride the theme that is used when request the page template for a page or a section.

While one cannot assign a theme to a section, you can assign a template to a section. config.toml is global for lack of a better word, while __index.md is per section.

content/corporate/_index.md

+++
title = "A Blog"
sort_by = "none"
template = "blog-section.html"
page_template = "blog-page.html"
+++

The one pointing to templates/blog-section.html and templates/blog-page.html

content/docs/_index.md

+++
title = "Documentation"
sort_by = "none"
template = "docs-section.html"
page_template = "docs-page.html"
+++

That does enable different looks for each section.

However, its not as easy as setting a pre-made theme for a section.