зеркало из https://github.com/github/docs.git
Merge branch 'main' into repo-sync
This commit is contained in:
Коммит
5163774a66
|
@ -1,4 +1,5 @@
|
|||
import { Heading, NavList } from '@primer/react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import cx from 'classnames'
|
||||
|
||||
import type { MiniTocItem } from 'components/context/ArticleContext'
|
||||
|
@ -11,9 +12,28 @@ export type MiniTocsPropsT = {
|
|||
}
|
||||
|
||||
function RenderTocItem(item: MiniTocItem) {
|
||||
const [currentAnchor, setCurrentAnchor] = useState('')
|
||||
|
||||
useEffect(() => {
|
||||
const onHashChanged = () => {
|
||||
setCurrentAnchor(window.location.hash)
|
||||
}
|
||||
|
||||
window.addEventListener('hashchange', onHashChanged)
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('hashchange', onHashChanged)
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className={cx(styles.nested, item.platform)}>
|
||||
<NavList.Item href={item.contents.href}>{item.contents.title}</NavList.Item>
|
||||
<NavList.Item
|
||||
aria-current={item.contents.href === currentAnchor && 'location'}
|
||||
href={item.contents.href}
|
||||
>
|
||||
{item.contents.title}
|
||||
</NavList.Item>
|
||||
{item.items && item.items.length > 0 && (
|
||||
<ul className={cx(styles.indentNested)}>
|
||||
{item.items.map((toc) => (
|
||||
|
|
|
@ -28,7 +28,6 @@ featuredLinks:
|
|||
- /actions/security-guides/encrypted-secrets
|
||||
changelog:
|
||||
label: actions
|
||||
product_video: 'https://www.youtube-nocookie.com/embed/cP0I9w2coGU'
|
||||
redirect_from:
|
||||
- /articles/automating-your-workflow-with-github-actions
|
||||
- /articles/customizing-your-project-with-github-actions
|
||||
|
|
|
@ -20,19 +20,16 @@ shortTitle: Quickstart
|
|||
## Getting started
|
||||
|
||||
1. [Install](https://github.com/cli/cli#installation) {% data variables.product.prodname_cli %} on macOS, Windows, or Linux.
|
||||
1. In the command line, authenticate to {% data variables.product.company_short %}.
|
||||
1. In the command line, authenticate to {% data variables.product.company_short %}.{% ifversion not fpt or ghec %} Replace `HOSTNAME` with the name of {% data variables.location.product_location %}. For example, `octo-inc.ghe.com`.{% endif %}
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
```shell
|
||||
gh auth login
|
||||
```
|
||||
|
||||
{% ifversion not fpt or ghec %}
|
||||
To authenticate to {% data variables.location.product_location %}, use the `--hostname` flag.
|
||||
|
||||
{% else %}
|
||||
```shell
|
||||
gh auth login --hostname HOSTNAME
|
||||
```
|
||||
|
||||
{% endif %}
|
||||
1. Start working with {% data variables.product.company_short %} in the command line. For example, find an issue to work on with `gh issue status` or `gh issue list --assignee @me`. Create a pull request with `gh pr create`. Review a pull request with `gh pr checkout`, `gh pr diff` and `gh pr review`.
|
||||
|
||||
|
|
|
@ -152,17 +152,6 @@ Location: /where/in/docs
|
|||
Transcript: ./content/video-transcripts/filename
|
||||
```
|
||||
|
||||
```
|
||||
Title: GitHub Actions - Supercharge your GitHub Flow
|
||||
URL: https://www.youtube-nocookie.com/embed/cP0I9w2coGU
|
||||
Description: A 3 minute overview of how GitHub Actions fits in the GitHub flow.
|
||||
Product: Actions
|
||||
Versions: All
|
||||
Date added: 2020-12-03
|
||||
Location: content/actions/index.md
|
||||
Transcript: TBD
|
||||
```
|
||||
|
||||
```
|
||||
Title: Codespaces - Your instant dev box in the cloud
|
||||
URL: https://www.youtube-nocookie.com/embed/_W9B7qc9lVc
|
||||
|
|
|
@ -5,11 +5,11 @@ versions:
|
|||
featuredLinks:
|
||||
videos:
|
||||
- title: codespaces
|
||||
href: 'https://www.youtube-nocookie.com/embed/cP0I9w2coGU'
|
||||
href: 'https://www.youtube-nocookie.com/embed/_W9B7qc9lVc'
|
||||
- title: more codespaces
|
||||
href: 'https://www.youtube-nocookie.com/embed/cP0I9w2coGU'
|
||||
href: 'https://www.youtube-nocookie.com/embed/_W9B7qc9lVc'
|
||||
- title: even more codespaces
|
||||
href: 'https://www.youtube-nocookie.com/embed/cP0I9w2coGU'
|
||||
href: 'https://www.youtube-nocookie.com/embed/_W9B7qc9lVc'
|
||||
videosHeading: Custom Videos heading
|
||||
layout: product-landing
|
||||
---
|
||||
|
|
|
@ -528,15 +528,15 @@ describe('Page class', () => {
|
|||
expect(page.featuredLinks.videos).toStrictEqual([
|
||||
{
|
||||
title: 'codespaces',
|
||||
href: 'https://www.youtube-nocookie.com/embed/cP0I9w2coGU',
|
||||
href: 'https://www.youtube-nocookie.com/embed/_W9B7qc9lVc',
|
||||
},
|
||||
{
|
||||
title: 'more codespaces',
|
||||
href: 'https://www.youtube-nocookie.com/embed/cP0I9w2coGU',
|
||||
href: 'https://www.youtube-nocookie.com/embed/_W9B7qc9lVc',
|
||||
},
|
||||
{
|
||||
title: 'even more codespaces',
|
||||
href: 'https://www.youtube-nocookie.com/embed/cP0I9w2coGU',
|
||||
href: 'https://www.youtube-nocookie.com/embed/_W9B7qc9lVc',
|
||||
},
|
||||
])
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче