content icon indicating copy to clipboard operation
content copied to clipboard

respectPathCase in defineTransformer()

Open IVANVOLKOVETS opened this issue 1 year ago • 1 comments

Hello! There is one thing that makes locales in paths look like in lowerCase "en-us" instead of like this for example: "en-US" respectPathCase is "false" by default inside defineTransformer() function in @nuxt\content\dist\runtime\transformers.

It would be much more convinient if there will be some config parameter or something else that will provide a control over this.

Thank you in advance for your time on this issue.

IVANVOLKOVETS avatar Jul 10 '24 13:07 IVANVOLKOVETS

You can set respectPathCase to true in module options in nuxt.config.ts

export default defineNuxtConfig({
  content: {
    respectPathCase: true
  }
})

Checkout https://content.nuxt.com/get-started/configuration#respectpathcase

farnabaz avatar Jul 19 '24 09:07 farnabaz

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Dec 08 '24 02:12 github-actions[bot]

okay how to do this in v3 @farnabaz ?

posts_tr_TR: defineCollection({
      type: 'page',
      source: {
        include: 'tr-TR/blog/*.md',
        prefix: '/tr-TR/blog',
      },
      schema: postsSchema,
    }),

Above gives me lowercase path e.g. path: "/tr-tr/blog/asian-cuisine" but I'm looking for path: "/tr-TR/blog/asian-cuisine"

hasan-ozbey avatar Feb 24 '25 21:02 hasan-ozbey

@hasan-ozbey You now pass lower: false in slugifyOptions https://content.nuxt.com/docs/getting-started/configuration#pathmetaslugifyoptions

farnabaz avatar Feb 27 '25 10:02 farnabaz