Current behavior
If you have a forward slash in your section name, the pagePerSection links are all broken, resulting in "Page not found". Removing the forward slashes in the names fixes the issue.
To reproduce
Simple styleguide.config.js:
module.exports = {
pagePerSection: true,
sections: [{
name: '@foo/components'
}, {
name: '@bar/components'
}]
};
Expected behavior
Links should work for any text in a section name field. Probably just need to urlencode the string.
Feel free to send a pull request with a fix.
:tada: This issue has been resolved in version 9.1.7 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
This appears to have fixed the top level section link, but any sub-links within that section are still unencoded and result in "Page not found".
@stonebk could you please give an example of the config file to get an exact idea of sub-links you are talking about?
I was able to reproduce your problem by applying your config from the description on Styleguidist sections example. I'd be glad to fix this as well.
@mendrew it looks something like this:
{
"webpackConfig": { ... },
"styleguideComponents": { ... },
"title": "Foundation Team APIs",
"usageMode": "expand",
"require": [ ... ],
"pagePerSection": true,
"sections": [
{
"name": "Introduction",
"content": "docs/introduction.md"
},
{
"name": "@zillow/zrs-activation",
"sections": [
{
"name": "Components",
"components": "/Users/stonebk/foundation-site/node_modules/@zillow/zrs-activation/src/components/**/[A-Z]*.{js,jsx,ts,tsx}"
}
]
},
{
"name": "@zillow/zrs-profile",
"sections": [
{
"name": "Components",
"components": "/Users/stonebk/foundation-site/node_modules/@zillow/zrs-profile/src/components/**/[A-Z]*.{js,jsx,ts,tsx}"
}
]
},
]
}
With that config, both the "Components" link under the section name, and all the links under "Components" have unencoded urls.
Awesome, thank you, I'll take a look.
Hi @stonebk. The fix has been released in v9.1.10.
Could you please take a look?
@mendrew, all better now! Thanks so much!
Awesome, you're welcome! 馃檪