1
0
mirror of synced 2026-02-02 15:02:03 -05:00

Merge branch 'main' into localized-mini-tocs-bugfix

This commit is contained in:
Sarah Schneider
2021-06-08 11:45:07 -04:00
committed by GitHub
4 changed files with 34 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
import NextLink from 'next/link'
import { ComponentProps } from 'react'
import { useMainContext } from 'components/context/MainContext'
const { NODE_ENV } = process.env
@@ -7,19 +8,38 @@ const enableNextLinks = false
type Props = { locale?: string } & ComponentProps<'a'>
export function Link(props: Props) {
const { airGap } = useMainContext()
const { href, locale, ...restProps } = props
if (!href && NODE_ENV !== 'production') {
console.warn('Missing href on Link')
}
const isExternal = href?.startsWith('http') || href?.startsWith('//')
// In airgap mode, add a tooltip to external links warning they may not work.
if (airGap && isExternal) {
if (restProps.className) {
restProps.className += ' tooltipped'
} else {
restProps.className = 'tooltipped'
}
restProps['aria-label'] = 'This link may not work in this environment.'
}
if (enableNextLinks) {
return (
<NextLink href={href || ''} locale={locale}>
<a {...restProps} />
<a rel={isExternal ? 'noopener' : ''} {...restProps} />
</NextLink>
)
}
return <a href={locale ? `/${locale}${href}` : href} {...restProps} />
return (
<a
href={locale ? `/${locale}${href}` : href}
rel={isExternal ? 'noopener' : ''}
{...restProps}
/>
)
}

View File

@@ -81,7 +81,7 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav
{% mac %}
1. {% data reusables.command_line.start_ssh_agent %}
{% data reusables.command_line.start_ssh_agent %}
2. If you're using macOS Sierra 10.12.2 or later, you will need to modify your `~/.ssh/config` file to automatically load keys into the ssh-agent and store passphrases in your keychain.
@@ -168,15 +168,7 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav
{% linux %}
1. {% data reusables.command_line.start_ssh_agent %}
In some Linux environments, you need root access to run the command:
```
$ sudo -s -H
$ eval "$(ssh-agent -s)"
> Agent pid 59566
```
{% data reusables.command_line.start_ssh_agent %}
2. Add your SSH private key to the ssh-agent. {% data reusables.ssh.add-ssh-key-to-ssh-agent %}
{% data reusables.ssh.add-ssh-key-to-ssh-agent-commandline %}

View File

@@ -31,7 +31,7 @@ You can delete unauthorized (or possibly compromised) SSH keys to ensure that an
4. Open Terminal.
5. {% data reusables.command_line.start_ssh_agent %}
{% data reusables.command_line.start_ssh_agent %}
6. Find and take a note of your public key fingerprint. {% if currentVersion ver_lt "enterprise-server@3.0" %}If you're using OpenSSH 6.7 or older:
```shell
@@ -109,7 +109,7 @@ You can delete unauthorized (or possibly compromised) SSH keys to ensure that an
4. Open Terminal.
5. {% data reusables.command_line.start_ssh_agent %}
{% data reusables.command_line.start_ssh_agent %}
6. Find and take a note of your public key fingerprint. {% if currentVersion ver_lt "enterprise-server@3.0" %}If you're using OpenSSH 6.7 or older:
```shell

View File

@@ -1,5 +1,8 @@
Start the ssh-agent in the background.
```shell
$ eval "$(ssh-agent -s)"
> Agent pid 59566
```
1. Start the ssh-agent in the background.
```shell
$ eval "$(ssh-agent -s)"
> Agent pid 59566
```
Depending on your environment, you may need to use a different command. For example, you may need to use root access by running `sudo -s -H` before starting the ssh-agent, or you may need to use `exec ssh-agent bash` or `exec ssh-agent zsh` to run the ssh-agent.