Merge branch 'main' into sublanding-fixes

This commit is contained in:
Sarah Schneider 2021-04-27 20:44:52 -04:00 коммит произвёл GitHub
Родитель c9ed737d80 2da5012a5a
Коммит 36599fa9c6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
16 изменённых файлов: 81 добавлений и 95 удалений

Двоичные данные
assets/images/help/repository/readme-automatic-toc-setting.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 360 KiB

Двоичные данные
assets/images/help/repository/readme-automatic-toc.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 175 KiB

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

@ -0,0 +1,37 @@
---
title: GitHub Enterprise Server releases
intro: Documentation for the currently supported and previously deprecated versions of {{ site.data.variables.product.prodname_ghe_server }}.
allowTitleToDifferFromFilename: true
versions:
enterprise-server: '*'
topics:
- enterprise
---
## Currently supported
See [{% data variables.product.prodname_enterprise %}](https://github.com/enterprise) for information about the latest release.
{% for supportedRelease in enterpriseServerReleases.supported %}
- [{% data variables.product.prodname_ghe_server %} {{supportedRelease}}](/enterprise-server@{{supportedRelease}})
{% endfor %}
## Deprecated
Documentation for deprecated versions remains available but is no longer maintained.
{% for deprecatedRelease in enterpriseServerReleases.deprecatedReleasesWithNewFormat %}
- [Enterprise Server {{deprecatedRelease}}](/enterprise-server@{{deprecatedRelease}})
{% endfor %}
{% for deprecatedReleaseLegacyFormat in enterpriseServerReleases.deprecatedReleasesWithLegacyFormat %}
- [Enterprise Server {{deprecatedReleaseLegacyFormat}}](/enterprise/{{deprecatedReleaseLegacyFormat}})
{% endfor %}
## Deprecated developer documentation
Developer documentation for deprecated versions remains available but is no longer maintained.
{% for deprecatedDevRelease in enterpriseServerReleases.deprecatedReleasesOnDeveloperSite %}
- [Enterprise Server {{deprecatedDevRelease}}](https://developer.github.com/enterprise/{{deprecatedDevRelease}})
{% endfor %}

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

@ -30,3 +30,5 @@ versions:
{% link_with_intro /enterprise-support %}
{% link_with_intro /release-notes %}
{% link_with_intro /all-releases %}

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

@ -42,9 +42,22 @@ If you put your README file in your repository's root, `docs`, or hidden `.githu
{% endif %}
### Auto-generated table of contents for README files
For the rendered view of any Markdown file in a repository, including README files, {% data variables.product.product_name %} will automatically generate a table of contents based on section headings. You can view the table of contents for a README file by clicking the {% octicon "list-unordered" aria-label="The unordered list icon" %} menu icon at the top left of the rendered page.
![README with automatically generated TOC](/assets/images/help/repository/readme-automatic-toc.png)
The auto-generated table of contents is enabled by default for all Markdown files in a repository, but you can disable this feature for your repository.
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
1. Under "Features", deselect **Table of contents**.
![Automatic TOC setting for repositories](/assets/images/help/repository/readme-automatic-toc-setting.png)
### Section links in README files and blob pages
Many projects use a table of contents at the start of a README to direct users to different sections of the file. {% data reusables.repositories.section-links %}
{% data reusables.repositories.section-links %}
### Relative links and image paths in README files

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

@ -64,14 +64,6 @@ contribution_cta:
button: Make a contribution
or: Or,
to_guidelines: learn how to contribute.
enterprise_releases_list:
title: Enterprise Server Releases
currently_supported: Currently supported
currently_supported_message: See <a href="https://github.com/enterprise">GitHub Enterprise</a> for information about the latest release.
deprecated: Deprecated
deprecated_message: 'These docs remain available but are no longer maintained:'
deprecated_developer: Deprecated on developer.github.com
deprecated_developer_message: 'These docs remain available on the legacy <a href="https://developer.github.com">developer site</a> but are no longer maintained:'
products:
graphql:
reference:

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

@ -0,0 +1 @@
<a class="f6 no-underline color-text-tertiary pt-1" href="/{{currentLanguage}}/{{enterpriseServerVersions[0]}}/admin/all-releases">See all Enterprise releases</a>

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

@ -14,7 +14,7 @@
>
{{ allVersions[permalink.pageVersion].versionTitle }}</a>
{% endfor %}
<a class="f6 no-underline color-text-tertiary pt-1" href="/enterprise-server-releases">See all Enterprise releases</a>
{% include all-enterprise-releases-link %}
</div>
</details>
{% endif %}

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

@ -39,7 +39,7 @@
<!-- END ONEOFF EARLY ACCESS NOTICE -->
{% if translation_notification_type %}
<div class="header-notifications text-center f5 color-bg-info-inverse color-text-primary py-4 px-6 translation_notice{% if release_notification_type %} border-bottom color-border-tertiary{% endif %}">
<div class="header-notifications text-center f5 color-bg-info color-text-primary py-4 px-6 translation_notice{% if release_notification_type %} border-bottom color-border-tertiary{% endif %}">
{{ translation_notification }}
</div>
{% endif %}

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

@ -24,6 +24,7 @@
>{{ allVersions[permalink.pageVersion].versionTitle }}</a>
{% endunless %}
{% endfor %}
{% include all-enterprise-releases-link %}
</div>
</details>
</div>

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

@ -1,67 +0,0 @@
<!doctype html>
<html lang="{{currentLanguage}}">
{% include head %}
<body class="d-lg-flex">
{% include sidebar %}
<main class="width-full">
{% include header %}
{% include deprecation-banner %}
<div class="container-xl px-3 px-md-6 my-4 my-lg-4 d-xl-flex">
<article class="markdown-body width-full">
<div class="d-lg-flex flex-justify-between"></div>
<div class="mt-2 article-grid-container">
<div class="article-grid-head">
<div class="d-flex flex-items-baseline flex-justify-between mt-3">
<h1 class="border-bottom-0">{% data ui.enterprise_releases_list.title %}</h1>
</div>
</div>
<div class="article-grid-toc border-bottom border-xl-0 pb-4 mb-5 pb-xl-0 mb-xl-0">
<div class="article-grid-toc-content">
{% if miniTocItems.size > 1 %}
<h2 id="in-this-article" class="f5 mb-2"><a class="Link--primary" href="#in-this-article">{% data ui.pages.miniToc %}</a></h2>
<ul class="list-style-none pl-0 f5 mb-0">
{% for item in miniTocItems %}
<li class="ml-{{ item.indentationLevel | times: 3 }} mb-2 lh-condensed">{{ item.contents }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
<div id="article-contents" class="article-grid-body">
<h2 id="currently-supported"><a href="#currently-supported">{% data ui.enterprise_releases_list.currently_supported %}</a></h2>
<p>{% data ui.enterprise_releases_list.currently_supported_message %}</p>
<ul>
{% for version in enterpriseServerReleases.supported %}
<li><a href="/{{currentLanguage}}/enterprise-server@{{version}}">Enterprise Server {{version}}</a></li>
{% endfor %}
</ul>
<h2 id="deprecated"><a href="#deprecated">{% data ui.enterprise_releases_list.deprecated %}</a></h2>
<p>{% data ui.enterprise_releases_list.deprecated_message %}</p>
<ul>
{% for version in enterpriseServerReleases.deprecatedReleasesWithNewFormat %}
<li><a href="/{{currentLanguage}}/enterprise-server@{{version}}">Enterprise Server {{version}}</a></li>
{% endfor %}
{% for version in enterpriseServerReleases.deprecatedReleasesWithLegacyFormat %}
<li><a href="/{{currentLanguage}}/enterprise/{{version}}">Enterprise Server {{version}}</a></li>
{% endfor %}
</ul>
<h2 id="deprecated-on-developer.github.com"><a href="#deprecated-on-developer.github.com">{% data ui.enterprise_releases_list.deprecated_developer %}</a></h2>
<p>{% data ui.enterprise_releases_list.deprecated_developer_message %}</p>
{% for version in enterpriseServerReleases.deprecatedReleasesOnDeveloperSite %}
<li><a href="https://developer.github.com/enterprise/{{version}}">Enterprise Server {{version}}</a></li>
{% endfor %}
</div>
</div>
</article>
</div>
{% include support-section %}
{% include small-footer %}
{% include scroll-button %}
</main>
</body>
</html>

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

@ -99,6 +99,15 @@ module.exports = function getOldPathsFromPath (currentPath, languageCode, curren
}
// ------ END MODERN VERSION FORMAT REPLACEMENTS ------//
// ------ BEGIN ONEOFF REPLACEMENTS ------//
// create special old path /enterprise-server-releases from current path /enterprise-server@<release>/admin/all-releases
if (versionSatisfiesRange(currentVersion, `=${latest}`) && currentPath.endsWith('/admin/all-releases')) {
oldPaths.add('/enterprise-server-releases')
}
// ------ END ONEOFF REPLACEMENTS ------//
// For each old path added to the set above, do the following...
(new Set(oldPaths)).forEach(oldPath => {
// for English only, remove language code

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

@ -50,7 +50,7 @@ function getNewHref (node, languageCode, version) {
// /enterprise-server/rest/reference/oauth-authorizations (this redirects to the latest version)
// /enterprise-server@latest/rest/reference/oauth-authorizations (this redirects to the latest version)
const firstLinkSegment = href.split('/')[1]
if ([...supportedPlans, ...supportedVersions, 'enterprise-server@latest'].includes(firstLinkSegment)) {
if ([...supportedPlans, ...supportedVersions, 'enterprise-server@latest'].some(v => firstLinkSegment.startsWith(v))) {
newHref = path.join('/', languageCode, href)
}

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

@ -1,13 +0,0 @@
const { liquid } = require('../lib/render-content')
const layouts = require('../lib/layouts')
const getMiniTocItems = require('../lib/get-mini-toc-items')
module.exports = async function enterpriseServerReleases (req, res, next) {
if (!req.path.endsWith('/enterprise-server-releases')) return next()
const html = await liquid.parseAndRender(layouts['enterprise-server-releases'], req.context)
req.context.miniTocItems = getMiniTocItems(html, 3, 'article')
return res.send(await liquid.parseAndRender(layouts['enterprise-server-releases'], req.context))
}

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

@ -130,7 +130,6 @@ module.exports = function (app) {
app.use(asyncMiddleware(instrument('./contextualizers/early-access-breadcrumbs')))
}
app.use(asyncMiddleware(instrument('./enterprise-server-releases')))
app.use(asyncMiddleware(instrument('./dev-toc')))
app.use(asyncMiddleware(instrument('./featured-links')))
app.use(asyncMiddleware(instrument('./learning-track')))

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

@ -409,7 +409,10 @@ describe('lint markdown content', () => {
// Filter out some very specific false positive matches
const matches = initialMatches.filter(match => {
if (markdownRelPath === 'content/admin/enterprise-management/migrating-from-github-enterprise-1110x-to-2123.md') {
if (
markdownRelPath === 'content/admin/enterprise-management/migrating-from-github-enterprise-1110x-to-2123.md' ||
markdownRelPath === 'content/admin/all-releases.md'
) {
return false
}
return true
@ -420,7 +423,16 @@ describe('lint markdown content', () => {
})
test('URLs must not contain a hard-coded domain name', async () => {
const matches = (content.match(domainLinkRegex) || [])
const initialMatches = (content.match(domainLinkRegex) || [])
// Filter out some very specific false positive matches
const matches = initialMatches.filter(match => {
if (markdownRelPath === 'content/admin/all-releases.md') {
return false
}
return true
})
const errorMessage = formatLinkError(domainLinkErrorText, matches)
expect(matches.length, errorMessage).toBe(0)
})