Skip to content

Commit b2aea0e

Browse files
authored
Docs - Fix development main entry (#3628)
* Fixed docs main entry when in development - was breaking private * Changed local host matching * Changed dev main entry to have only prefix
1 parent 4aab0ae commit b2aea0e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

docuilib/docusaurus.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const darkCodeTheme = themes.dracula;
1818
trailingSlash: false,
1919
customFields: {
2020
docsMainEntry: 'getting-started/setup',
21+
docsDevelopmentVersion: 'next',
2122
expoSnackLink: 'https://snack.expo.io/@ethanshar/rnuilib_snack',
2223
stars: '4.7'
2324
},

docuilib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uilib-docs",
3-
"version": "3.10.0",
3+
"version": "3.11.0",
44
"main": "./src/index.ts",
55
"scripts": {
66
"docusaurus": "docusaurus",

docuilib/src/components/MainSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const STARS_COUNT_KEY = 'starsCount';
1010

1111
export default () => {
1212
const {siteConfig} = useDocusaurusContext();
13-
const {expoSnackLink, docsMainEntry} = siteConfig.customFields;
13+
const {expoSnackLink, docsMainEntry, docsDevelopmentVersion} = siteConfig.customFields;
1414
const [starsCount, setStarsCount] = useState(localStorage.getItem(STARS_COUNT_KEY) ?? siteConfig.customFields.stars);
1515

1616
useEffect(() => {
@@ -40,7 +40,7 @@ export default () => {
4040
</div>
4141

4242
<div className={styles.buttons}>
43-
<Link to={`docs/${location.hostname === 'localhost' ? 'next/' : ''}${docsMainEntry}`}>
43+
<Link to={`/docs/${location.hostname === 'localhost' ? `${docsDevelopmentVersion}/` : ''}${docsMainEntry}`}>
4444
<button className={'button dark'}>View Docs</button>
4545
</Link>
4646

0 commit comments

Comments
 (0)