Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use theme only for a certain folder? #104

Open
paololazzari opened this issue Oct 24, 2024 · 2 comments
Open

How to use theme only for a certain folder? #104

paololazzari opened this issue Oct 24, 2024 · 2 comments

Comments

@paololazzari
Copy link

If I have content/foo and content/bar, how do I apply the theme only for foo ?

@bep
Copy link
Owner

bep commented Oct 24, 2024

That is a good question. Hugo applies themes as filesystem overlays, so you can have multiple themes on top of each other.

The below is totally untested, but could/should in my head work:

[module]
    [[module.imports]]
        path = "github.com/bep/docuapi/v2"

    [[module.imports.mounts]]
        source = "i18n"
        target = "i18n"

    [[module.imports.mounts]]
        source = "layouts"
        target = "layouts"
    
    [[module.imports.mounts]]
        source = "layouts"
        target = "layouts/foo"

    [[module.imports.mounts]]
        source = "assets"
        target = "assets"

    [[module.imports.mounts]]
        source = "static"
        target = "static"

Note the "double mounting" of layouts.

Also note that I'm not totally sure if the above works, but please let me know if it does.

@paololazzari
Copy link
Author

@bep thanks for the quick reply.

I'm afraid this isn't working for me, the theme is still being loaded for both foo and bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants