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

layoutFallbacks not working #1517

Closed
itpropro opened this issue Sep 11, 2022 · 1 comment · Fixed by #1519
Closed

layoutFallbacks not working #1517

itpropro opened this issue Sep 11, 2022 · 1 comment · Fixed by #1519

Comments

@itpropro
Copy link
Sponsor Contributor

itpropro commented Sep 11, 2022

Environment

  • Operating System: Windows_NT
  • Node Version: v16.16.0
  • Nuxt Version: 3.0.0-rc.9
  • Nitro Version: 0.5.1
  • Package Manager: pnpm@7.11.0
  • Builder: vite
  • User Config: modules, nitro, content
  • Runtime Modules: @nuxt/content@2.1.0
  • Build Modules: -

Reproduction

I used the content wind template as base and added a component to display the respective objects. The about page is not using the full-width layout, event though specified in the _theme.yml. You can find the reproduction here:
https://stackblitz.com/edit/github-t3qfjp?file=components%2Fcontent%2FGlobalsTest.vue,content%2F_theme.yml

Describe the bug

I found no working way to make the layoutFallbacks option work. Even with document driven mode configured like this:

documentDriven: {
      globals: {
        theme: {
          where: [
            {
              _id: 'content:_theme.yml',
            },
          ],
        },
      },
      layoutFallbacks: ['theme'],
    },

the layout is always the default one. The theme.yml looks like this:

layout: 'full-width'

As the bug is reproducable with all of the examples referenced in the docs, I think the feature is just not working at all.
Also the documented way of resolving the theme from the docs (const { theme } = useContent().globals;) and the useTheme composable don't work.

Additional context

No response

Logs

No response

@itpropro
Copy link
Sponsor Contributor Author

Thanks @farnabaz for resolving this 👍

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

Successfully merging a pull request may close this issue.

1 participant