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

<ContentDoc /> component path property must be lower letter #2447

Closed
lxxaisy opened this issue Nov 23, 2023 · 7 comments
Closed

<ContentDoc /> component path property must be lower letter #2447

lxxaisy opened this issue Nov 23, 2023 · 7 comments
Labels

Comments

@lxxaisy
Copy link

lxxaisy commented Nov 23, 2023

Environment


  • Operating System: Darwin
  • Node Version: v16.14.2
  • Nuxt Version: 3.6.2
  • CLI Version: 3.10.0
  • Nitro Version: 2.7.2
  • Package Manager: pnpm@8.7.4
  • Builder: -
  • User Config: modules, build, devtools, content
  • Runtime Modules: @nuxtjs/tailwindcss@6.8.0, @nuxt/content@2.9.0
  • Build Modules: -

Reproduction

WX20231123-191625@2x
WX20231123-191637@2x

the first screenshot is the code.the second is the web show. clearly if the route.path is lower letter it works.

Describe the bug

WX20231123-190833@2x

like the screenshot, the $route.path is "codepenio/easyComSlider". but when i use in the pages/codepenio/easyComSlider.vue can not render the markdown file. when i add path "codepenio/easycomslider" it works.
according to the article,default path is the $route.path. is the path lower letter is neccessary.

please forgive my terrible english.

Additional context

No response

Logs

No response

@AssetCEO
Copy link

Although the case of URLs does not affect URL resolution in most cases, it is generally recommended to use lowercase and separate each word with a hyphen (-) for SEO purposes. For example, codepenio/easyComSlider is recommended to be changed to codepenio/easy-com-slider. This is because the URL easyComSlider is easily parsed as ONE word instead of three words.

雖然URL的大小寫在多數狀況下不影響網址解析。但就SEO的角度來看,通常建議使用小寫,並將各個單字用-隔開。例如 codepenio/easyComSlider ,建議改成 codepenio/easy-com-slider。這是因為easyComSlider容易被解析成一個字,而非三個字。

@lxxaisy
Copy link
Author

lxxaisy commented Nov 28, 2023

Thank you for the comment and the recommend.But the documentation about ContentDoc confused me.The path default value is the $route.path,but when it is not the lower letter,it will not work.

@AssetCEO
Copy link

I agree with your point. Perhaps the official documentation should remind users about this issue, or update the path parsing logic. However, I would recommend the former, for SEO purposes.

@lxxaisy
Copy link
Author

lxxaisy commented Nov 28, 2023

Thank you again and I will follow your recommend.

@dominik-kuhn
Copy link

I have the same issue with resolving the path in queryContent(). It doesnt work if capital letters appear in the path. If this is a desired behavior, it should be mentioned in the documentation and also in the migration guide, as it still worked with capital letters in the old version of nuxt-content.

Copy link

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 github-actions bot added the Stale label Aug 20, 2024
Copy link

This issue was closed because it has been stalled for 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants