Skip to content

Commit c9b7013

Browse files
authored
Merge pull request #5387 from github/repo-sync
repo sync
2 parents 8e59704 + ebce5f2 commit c9b7013

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

includes/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h4 class="text-mono f5 text-normal color-text-secondary d-md-none">{% data ui.h
5252
<div class="d-md-inline-block">
5353

5454
<!-- Language picker - 'English', 'Japanese', etc -->
55-
{% unless error == '404' or !page.hidden %}
55+
{% if page.languageVariants.length > 0 and error != '404' and !page.hidden %}
5656
<div class="border-top border-md-top-0 py-2 py-md-0 d-md-inline-block">
5757
<details class="dropdown-withArrow position-relative details details-reset mr-md-3 close-when-clicked-outside">
5858
<summary class="py-2 color-text-primary" role="button" aria-label="Toggle languages list">
@@ -84,7 +84,7 @@ <h4 class="text-mono f5 text-normal color-text-secondary d-md-none">{% data ui.h
8484
</div>
8585
</details>
8686
</div>
87-
{% endunless %}
87+
{% endif %}
8888

8989
<!-- GitHub.com homepage and 404 page has a stylized search; Enterprise homepages do not -->
9090
{% if page.relativePath != 'index.md' and error != '404' %}

layouts/enterprise-server-releases.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% include header %}
1010
{% include deprecation-banner %}
1111

12-
<main class="container-xl px-3 px-md-6 my-4 my-lg-4 d-xl-flex">
12+
<div class="container-xl px-3 px-md-6 my-4 my-lg-4 d-xl-flex">
1313
<article class="markdown-body width-full">
1414
<div class="d-lg-flex flex-justify-between"></div>
1515

@@ -55,14 +55,13 @@ <h2 id="deprecated-on-developer.github.com"><a href="#deprecated-on-developer.gi
5555
{% for version in enterpriseServerReleases.deprecatedReleasesOnDeveloperSite %}
5656
<li><a href="https://developer.github.com/enterprise/{{version}}">Enterprise Server {{version}}</a></li>
5757
{% endfor %}
58-
{% include support-section %}
59-
{% include small-footer %}
60-
{% include scroll-button %}
6158
</div>
6259
</div>
6360
</article>
64-
</main>
65-
61+
</div>
62+
{% include support-section %}
63+
{% include small-footer %}
64+
{% include scroll-button %}
6665
</main>
6766
</body>
6867
</html>

lib/get-mini-toc-items.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
const cheerio = require('cheerio')
22
const { range } = require('lodash')
33

4-
module.exports = function getMiniTocItems (html, maxHeadingLevel = 3) {
4+
module.exports = function getMiniTocItems (html, maxHeadingLevel = 3, headingScope = '') {
55
const $ = cheerio.load(html, { xmlMode: true })
66

77
// eg `h2, h3` or `h2, h3, h4` depending on maxHeadingLevel
8-
const selector = range(2, maxHeadingLevel + 1).map(num => `h${num}`).join(', ')
8+
const selector = range(2, maxHeadingLevel + 1).map(num => `${headingScope} h${num}`).join(', ')
99
const headings = $(selector)
1010

1111
// return an array of objects containing each heading's contents, level, and optional platform.

middleware/enterprise-server-releases.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = async function enterpriseServerReleases (req, res, next) {
77

88
const html = await liquid.parseAndRender(layouts['enterprise-server-releases'], req.context)
99

10-
req.context.miniTocItems = getMiniTocItems(html)
10+
req.context.miniTocItems = getMiniTocItems(html, 3, 'article')
1111

1212
return res.send(await liquid.parseAndRender(layouts['enterprise-server-releases'], req.context))
1313
}

0 commit comments

Comments
 (0)