-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: attempt to fix release notes links (#2000)
* fix: attempt to fix release notes links * chore: changeset * chore: another attempo * chore: attempt with custom page * chore: megamenu link * chore: sidebar link fix * chore: remove leftover * chore: added release-notes.yaml * chore: add initial docs * chore: use gatsby-config data * chore: remove leftover
- Loading branch information
1 parent
6818cc2
commit 2da2bac
Showing
7 changed files
with
62 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@commercetools-docs/gatsby-theme-docs': patch | ||
'@commercetools-website/docs-smoke-test': patch | ||
--- | ||
|
||
Fix internal links to release notes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/gatsby-theme-docs/src/hooks/use-release-notes-config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { buildReleaseNotesQueryString } from '../utils/release-notes'; | ||
import { useSiteData } from './use-site-data'; | ||
|
||
const OTHER_GROUP_SITE_PREFIXES = ['/docs']; // let's yse pathPrefix to identify websites (works only on prod) | ||
|
||
const useReleaseNotesConfig = () => { | ||
const { | ||
pathPrefix, | ||
siteMetadata: { products, title }, | ||
} = useSiteData(); | ||
|
||
const getReleaseNotesUrl = () => { | ||
const product = products?.[0]; | ||
|
||
const queryString = buildReleaseNotesQueryString( | ||
OTHER_GROUP_SITE_PREFIXES.includes(pathPrefix) ? 'other' : 'product', | ||
title, | ||
product | ||
); | ||
return `/docs/release-notes${queryString}`; // only prod url | ||
}; | ||
|
||
return { getReleaseNotesUrl }; | ||
}; | ||
|
||
export default useReleaseNotesConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters