nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.08k stars 624 forks source link

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

Closed lxxaisy closed 1 week ago

lxxaisy commented 10 months ago

Environment


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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

Thank you again and I will follow your recommend.

dominik-kuhn commented 7 months ago

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.

github-actions[bot] commented 1 month ago

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] commented 1 week ago

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