Skip to content

Commit

Permalink
fix: add blog link with navigation fix (#1960)
Browse files Browse the repository at this point in the history
This PR adds a link to the new blog and addresses a formatting issue in
the docs navigation
  • Loading branch information
johnathonroach committed Sep 28, 2022
1 parent 618963c commit efaed67
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/website/components/link/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';
import Link from 'next/link';

const WrappedLink = ({ tabIndex = 0, href, ...otherProps }) => (
const WrappedLink = ({ tabIndex = 0, href, target = '_self', ...otherProps }) => (
<Link href={href} {...otherProps}>
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
<a {...otherProps} tabIndex={tabIndex} onClick={otherProps.onClick}>
<a target={target} {...otherProps} tabIndex={tabIndex} onClick={otherProps.onClick}>
{otherProps.children}
</a>
</Link>
Expand All @@ -16,6 +16,7 @@ WrappedLink.propTypes = {
className: PropTypes.string,
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),
href: PropTypes.string.isRequired,
target: PropTypes.string,
};

export default WrappedLink;
1 change: 1 addition & 0 deletions packages/website/components/navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export default function Navigation({ isProductApp }) {
</div>
) : (
<Link
target={item.text === 'Blog' ? '_blank' : '_self'}
key={item.text}
href={item.url}
className={clsx('nav-item', item.url === router.route ? 'current-page' : '')}
Expand Down
5 changes: 5 additions & 0 deletions packages/website/content/pages/general.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
"url": "/faq",
"text": "FAQ"
},
{
"url": "https://blog.web3.storage",
"text": "Blog",
"target": "_blank"
},
{
"url": "/docs",
"text": "Docs"
Expand Down
4 changes: 4 additions & 0 deletions packages/website/modules/docs-theme/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
background-size: cover;
word-break: break-word;

#navigation {
word-break: normal;
}

#footer_squiggle {
width: 25rem;
left: -6.5rem;
Expand Down

0 comments on commit efaed67

Please sign in to comment.