Skip to content

Commit 3ecbdd4

Browse files
authored
Branch was updated using the 'autoupdate branch' Actions workflow.
2 parents 2244a1f + 031843b commit 3ecbdd4

11 files changed

Lines changed: 43 additions & 114 deletions

File tree

Lines changed: 1 addition & 1 deletion
Loading

assets/images/octicons/search.svg

Lines changed: 1 addition & 1 deletion
Loading

assets/images/octicons/x.svg

Lines changed: 1 addition & 1 deletion
Loading

includes/article-version-switcher.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<summary class="f4 h5-mktg btn-outline-mktg btn-mktg p-2">
44
<!-- GitHub.com, Enterprise Server 2.16, etc -->
55
<span class="d-md-none d-xl-inline-block">{% data ui.pages.article_version %}</span> {{ allVersions[currentVersion].versionTitle }}
6-
<svg class="arrow ml-1" width="14px" height="8px" viewBox="0 0 14 8" xml:space="preserve" fill="none" stroke="#1277eb"><path d="M1,1l6.2,6L13,1"></path></svg>
6+
<svg class="arrow ml-1" width="14px" height="8px" viewBox="0 0 14 8" xml:space="preserve" fill="none" stroke="currentColor"><path d="M1,1l6.2,6L13,1"></path></svg>
77
</summary>
88

99
<div class="nav-dropdown position-absolute color-bg-primary rounded-1 px-4 py-3 top-7 color-shadow-large" style="z-index: 6; width: 210px;">

includes/footer.html

Lines changed: 0 additions & 90 deletions
This file was deleted.

includes/header-notification.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
{% endif %}
4646

4747
{% if release_notification_type %}
48-
<div class="header-notifications text-center f5 color-bg-info-inverse color-text-primary py-4 px-6 release_notice{% if early_access_notification_type %} border-bottom color-border-tertiary{% endif %}">
48+
<div class="header-notifications text-center f5 color-bg-info color-text-primary py-4 px-6 release_notice{% if early_access_notification_type %} border-bottom color-border-tertiary{% endif %}">
4949
{{ release_notification }}
5050
</div>
5151
{% endif %}

includes/header.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h4 class="text-mono f5 text-normal color-text-secondary d-md-none">{% data ui.h
2727
<!-- Product switcher - GitHub.com, Enterprise Server, etc -->
2828
<!-- 404 and 500 error layouts are not real pages so we need to hardcode the name for those -->
2929
{{ productMap[currentProduct].name }}
30-
<svg class="arrow ml-md-1" width="14px" height="8px" viewBox="0 0 14 8" xml:space="preserve" fill="none" stroke="#1277eb"><path d="M1,1l6.2,6L13,1"></path></svg>
30+
<svg class="arrow ml-md-1" width="14px" height="8px" viewBox="0 0 14 8" xml:space="preserve" fill="none" stroke="currentColor"><path d="M1,1l6.2,6L13,1"></path></svg>
3131
</div>
3232
</summary>
3333
<!-- Mobile-only product dropdown -->
@@ -38,7 +38,7 @@ <h4 class="text-mono f5 text-normal color-text-secondary d-md-none">{% data ui.h
3838
{% if product.id == currentProduct %}color-text-link-mktg text-underline active{% elsif product.id == currentProduct.id %}color-text-link-mktg text-underline active{% else %}Link--primary no-underline{% endif %}">
3939
{{ product.name }}
4040
{% if product.external %}
41-
<span class="ml-1"><svg width="9" height="10" viewBox="0 0 9 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path stroke="#24292e" d="M.646 8.789l8-8M8.5 9V1M1 .643h8"/></svg></span>
41+
<span class="ml-1"><svg width="9" height="10" viewBox="0 0 9 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path stroke="currentColor" d="M.646 8.789l8-8M8.5 9V1M1 .643h8"/></svg></span>
4242
{% endif %}
4343
</a>
4444
{% endfor %}
@@ -62,7 +62,7 @@ <h4 class="text-mono f5 text-normal color-text-secondary d-md-none">{% data ui.h
6262
{% else %}
6363
{{ languages[page.languageCode].name }}
6464
{% endif %}
65-
<svg class="arrow ml-md-1" width="14px" height="8px" viewBox="0 0 14 8" xml:space="preserve" fill="none" stroke="#1B1F23"><path d="M1,1l6.2,6L13,1"></path></svg>
65+
<svg class="arrow ml-md-1" width="14px" height="8px" viewBox="0 0 14 8" xml:space="preserve" fill="none" stroke="currentColor"><path d="M1,1l6.2,6L13,1"></path></svg>
6666
</div>
6767
</summary>
6868
<div id="languages-selector" class="position-md-absolute nav-desktop-langDropdown p-md-4 right-md-n4 top-md-6" style="z-index: 6;">
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const layouts = require('../../lib/layouts')
2+
3+
module.exports = function layoutContext (req, res, next) {
4+
if (!req.context.page) return next()
5+
6+
let layoutName
7+
8+
if (req.context.page.layout) {
9+
// Layouts can be specified with a `layout` frontmatter value.
10+
// Any invalid layout values will be caught by frontmatter schema validation.
11+
layoutName = req.context.page.layout
12+
// A `layout: false` value means use no layout.
13+
} else if (req.context.page.layout === false) {
14+
layoutName = ''
15+
// If undefined, use either the default layout or the generic-toc layout.
16+
} else if (req.context.page.layout === undefined) {
17+
layoutName = 'default'
18+
}
19+
20+
// Attach to the context object
21+
req.context.currentLayoutName = layoutName
22+
req.context.currentLayout = layouts[layoutName]
23+
24+
return next()
25+
}

middleware/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ module.exports = function (app) {
110110
app.use(instrument('./contextualizers/rest'))
111111
app.use(instrument('./contextualizers/webhooks'))
112112
app.use(asyncMiddleware(instrument('./contextualizers/whats-new-changelog')))
113+
app.use(instrument('./contextualizers/layout'))
113114
app.use(asyncMiddleware(instrument('./breadcrumbs')))
114115
app.use(asyncMiddleware(instrument('./early-access-breadcrumbs')))
115116
app.use(asyncMiddleware(instrument('./enterprise-server-releases')))

middleware/render-page.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,8 @@ module.exports = async function renderPage (req, res, next) {
136136
}
137137
}
138138

139-
// Layouts can be specified with a `layout` frontmatter value
140-
// If unspecified, `layouts/default.html` is used.
141-
// Any invalid layout values will be caught by frontmatter schema validation.
142-
const layoutName = context.page.layout || 'default'
143-
144-
// Set `layout: false` to use no layout
145-
const layout = context.page.layout === false ? '' : layouts[layoutName]
146-
147-
const output = await liquid.parseAndRender(layout, context)
139+
// currentLayout is added to the context object in middleware/contextualizers/layouts
140+
const output = await liquid.parseAndRender(req.context.currentLayout, context)
148141

149142
// First, send the response so the user isn't waiting
150143
// NOTE: Do NOT `return` here as we still need to cache the response afterward!

0 commit comments

Comments
 (0)