-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add external doc sidebar links and replace "Changelog" with one. (#1273)
* Add external doc sidebar links and replace "Changelog" with one. Keep in mind that this is meant as a quick fix, and the current sidebar system is likely to be overhauled in the future in a way that will have the functionality, but not necessarily invoked with the same "type" syntax. This branch allows the sidebar to have external links, and changes the "Changelog" link at the end to be a link to the DVC GitHub. Both the sidebar utils and component had to be changed to enable this- the sidebar utils moreso as the "external" type bypasses previous logic entirely. Anything without "external" set on it is treated the same, however. The component change just treats external-typed entries a little differently by setting `target=_blank` and preventing the `href` from having anything prepended to it. The best solution is to move this out of the component level entirely, but the best solution isn't the quickest and I've already mentioned big sidebar changes are coming soon. * Remove `target: null` from non-external links. My mistake, I thought `null` was the proper syntax here and I guess the linter missed it. * Change existing changelog link on Community to point to releases * Change sidebar link to releases page * Change external link component choice to an if statement. This is easier to read for most people, and also works better with linters. * Make sidebar "type" type field optional * Add an external link icon ID to the changelog sidebar item I just grabbed an SVG we already had. It could use some work, but this is a simple working implementation so it's worth pushing. * Use SVGR for sidebar external icon * Let findChildWithSource accept external links Some parts of the application still use the sidebar.json helpers to determine their links, and when attempting to do so on external-type links broke the build. This change fixes that situation, letting the `findChildWithSource` function adapt to input that isn't internal. It's a bit ugly, but this whole branch is a bit ugly. The sidebar overhaul should take care of this more cleanly in the future. * Remove old changelog pages I'm sorry, they look like they took some effort to write! But that's also the reason we have to stop writing these and get rid of the old ones. * Change sidebar external icon link to match font color. I made a new SVG based off the other one. It uses "currentColor" so it will take on the color of its surrounding font by default, and also is fully transparent. This new SVG is only used in the sidebar- other external link icons are still the old hard-coded blue and white one. * Change external link url to be under `url` key * Add `target="_blank"` on externals by default. This is done the same way as we already do `rel="noopener noreferrer"`. The change applies site-wide, but only to external links that don't specify a target. `target` can still be overridden with anything, including a blank string. * Fix tests for new temporary sidebar logic * Move new icon to same dir as sidebar menu component
- Loading branch information
1 parent
b716311
commit 26130d4
Showing
9 changed files
with
103 additions
and
180 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
1 change: 1 addition & 0 deletions
1
src/components/Documentation/Layout/SidebarMenu/external-link-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.