Merge branch 'main' into repo-sync

This commit is contained in:
Octomerger Bot 2023-02-14 11:34:38 -08:00 коммит произвёл GitHub
Родитель 6742f95b37 c4a3e94faa
Коммит 5163774a66
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 30 добавлений и 25 удалений

Просмотреть файл

@ -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

6
tests/fixtures/article-with-videos.md поставляемый
Просмотреть файл

@ -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',
},
])