Skip to content

Commit 3f615c0

Browse files
authored
Branch was updated using the 'autoupdate branch' Actions workflow.
2 parents f1582f0 + 39e0e0d commit 3f615c0

34 files changed

Lines changed: 1532 additions & 1550 deletions

File tree

content/actions/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ versions:
6666
</div>
6767

6868
<div class="d-flex flex-wrap gutter">
69-
{% render 'code-example-card' for actionsCodeExamples as example %}
69+
{% render code-example-card for actionsCodeExamples as example %}
7070
</div>
7171

7272
<button class="js-filter-card-show-more btn btn-outline float-right" data-js-filter-card-max="6">Show more {% octicon "arrow-right" %}</button>

content/discussions/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ versions:
4040
<h2 class="mb-2 font-mktg h1">Communities using discussions</h2>
4141

4242
<div class="d-flex flex-wrap gutter">
43-
{% render 'discussions-community-card' for discussionsCommunityExamples as example %}
43+
{% render discussions-community-card for discussionsCommunityExamples as example %}
4444
</div>
4545
{% if discussionsCommunityExamples.length > 6 %}
4646
<button class="js-filter-card-show-more btn btn-outline float-right" data-js-filter-card-max="6">Show more {% octicon "arrow-right" %}</button>

content/github/finding-security-vulnerabilities-and-errors-in-your-code/sarif-support-for-code-scanning.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ Any valid SARIF 2.1.0 output file can be uploaded, however, {% data variables.pr
9797
| `partialFingerprints`| **Required.** A set of strings used to track the unique identity of the result. {% data variables.product.prodname_code_scanning_capc %} uses `partialFingerprints` to accurately identify which results are the same across commits and branches. {% data variables.product.prodname_code_scanning_capc %} will attempt to use `partialFingerprints` if they exist. If you are uploading third-party SARIF files with the `upload-action`, the action will create `partialFingerprints` for you when they are not included in the SARIF file. For more information, see "[Preventing duplicate alerts using fingerprints](#preventing-duplicate-alerts-using-fingerprints)." **Note:** {% data variables.product.prodname_code_scanning_capc %} only uses the `primaryLocationLineHash`.
9898
| `codeFlows[].threadFlows[].locations[]`| **Optional.** An array of `location` objects for a `threadFlow` object, which describes the progress of a program through a thread of execution. A `codeFlow` object describes a pattern of code execution used to detect a result. If code flows are provided, {% data variables.product.prodname_code_scanning %} will expand code flows on {% data variables.product.prodname_dotcom %} for the relevant result. For more information, see the [`location` object](#location-object).
9999
| `relatedLocations[]`| A set of locations relevant to this result. {% data variables.product.prodname_code_scanning_capc %} will link to related locations when they are embedded in the result message. For more information, see the [`location` object](#location-object).
100-
| `suppressions[].state`| **Optional.** When the `state` is set to `accepted`, {% data variables.product.prodname_code_scanning %} will update the state of the result to `Closed` on {% data variables.product.prodname_dotcom %}.
101100

102101
#### `location` object
103102

layouts/product-landing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ <h2 class="font-mktg h1 mb-2">Guides</h2>
120120

121121
<div class="d-lg-flex gutter-lg flex-items-stretch">
122122
{% assign guideCards = featuredLinks.guideCards %}
123-
{% render "guide-card" for guideCards as guide %}
123+
{% render guide-card for guideCards as guide %}
124124
</div>
125125

126126
<a href="{{ currentPath }}/guides" class="btn btn-outline float-right">Explore guides {% octicon "arrow-right" %}</a>

lib/liquid-tags/data.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
const Liquid = require('liquid')
1+
const { TokenizationError } = require('liquidjs')
22

33
const Syntax = /([a-z0-9/\\_.\-[\]]+)/i
44
const SyntaxHelp = "Syntax Error in 'data' - Valid syntax: data [path]"
55

6-
module.exports = class Data extends Liquid.Tag {
7-
constructor (template, tagName, markup) {
8-
super(template, tagName, markup)
9-
10-
const match = Syntax.exec(markup)
11-
if (!match) {
12-
throw new Liquid.SyntaxError(SyntaxHelp)
6+
module.exports = {
7+
parse (tagToken) {
8+
if (!tagToken || !Syntax.test(tagToken.args)) {
9+
throw new TokenizationError(SyntaxHelp, tagToken)
1310
}
1411

15-
this.path = match[1]
16-
}
12+
this.path = tagToken.args
13+
},
1714

18-
async render (context) {
19-
const value = await context.get(`site.data.${this.path}`)
15+
async render (scope) {
16+
const value = await this.liquid.evalValue(`site.data.${this.path}`, scope)
2017
if (typeof value !== 'string') return value
21-
return this.template.engine.parseAndRender(value, context)
18+
return this.liquid.parseAndRender(value, scope.environments)
2219
}
2320
}

lib/liquid-tags/extended-markdown.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const Liquid = require('liquid')
2-
31
const tags = {
42
mac: '',
53
windows: '',
@@ -13,11 +11,26 @@ const tags = {
1311

1412
const template = '<div class="extended-markdown {{ tagName }} {{ classes }}">{{ output }}</div>'
1513

16-
class ExtendedMarkdown extends Liquid.Block {
17-
async render (context) {
18-
const chunks = await super.render(context)
19-
const output = Liquid.Helpers.toFlatString(chunks)
20-
return this.template.engine.parseAndRender(template, {
14+
const ExtendedMarkdown = {
15+
type: 'block',
16+
17+
parse (tagToken, remainTokens) {
18+
this.tagName = tagToken.name
19+
this.templates = []
20+
21+
const stream = this.liquid.parser.parseStream(remainTokens)
22+
stream
23+
.on(`tag:end${this.tagName}`, () => stream.stop())
24+
.on('template', tpl => this.templates.push(tpl))
25+
.on('end', () => {
26+
throw new Error(`tag ${tagToken.getText()} not closed`)
27+
})
28+
stream.start()
29+
},
30+
31+
render: function * (scope) {
32+
const output = yield this.liquid.renderer.renderTemplates(this.templates, scope)
33+
return yield this.liquid.parseAndRender(template, {
2134
tagName: this.tagName,
2235
classes: tags[this.tagName],
2336
output
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const Link = require('./link')
2-
31
// For details, see class method in lib/liquid-tags/link.js
4-
module.exports = class HomepageLinkWithIntro extends Link {}
2+
const link = require('./link')
3+
module.exports = link('homepage-link-with-intro')

lib/liquid-tags/indented-data-reference.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const Liquid = require('liquid')
21
const assert = require('assert')
32

43
// This class supports a tag that expects two parameters, a data reference and `spaces=NUMBER`:
@@ -10,11 +9,15 @@ const assert = require('assert')
109
// reference is used inside a block element (like a list or nested list) without
1110
// affecting the formatting when the reference is used elsewhere via {{ site.data.foo.bar }}.
1211

13-
module.exports = class IndentedDataReference extends Liquid.Tag {
12+
module.exports = {
13+
parse (tagToken) {
14+
this.markup = tagToken.args.trim()
15+
},
16+
1417
async render (context) {
1518
// obfuscate first legit space, remove all other spaces, then restore legit space
1619
// this way we can support spaces=NUMBER as well as spaces = NUMBER
17-
const input = this.markup.trim()
20+
const input = this.markup
1821
.replace(/\s/, 'REALSPACE')
1922
.replace(/\s/g, '')
2023
.replace('REALSPACE', ' ')
@@ -27,7 +30,7 @@ module.exports = class IndentedDataReference extends Liquid.Tag {
2730
assert(parseInt(numSpaces) || numSpaces === '0', '"spaces=NUMBER" must include a number')
2831

2932
// Get the referenced value from the context
30-
const value = await context.get(dataReference)
33+
const value = await this.liquid.evalValue(dataReference, context)
3134

3235
// If nothing is found in the context, exit with nothing; this may
3336
// feel weird and that we should throw an error, but this is "The Liquid Way TM"
@@ -36,6 +39,6 @@ module.exports = class IndentedDataReference extends Liquid.Tag {
3639
// add spaces to each line
3740
const renderedReferenceWithIndent = value.replace(/^/mg, ' '.repeat(numSpaces))
3841

39-
return this.template.engine.parseAndRender(renderedReferenceWithIndent, context)
42+
return this.liquid.parseAndRender(renderedReferenceWithIndent, context)
4043
}
4144
}
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
const Link = require('./link')
1+
const link = require('./link')
2+
const linkAsArticleCard = link('link-as-article-card')
23

34
// For details, see class method in lib/liquid-tags/link.js
4-
module.exports = class LinkAsArticleCard extends Link {
5-
async renderPageProps (page, ctx, props) {
6-
const renderedProps = await super.renderPageProps(page, ctx, props)
7-
const { type: typeKey, topics = [] } = page
8-
const typeVal = typeKey ? ctx.site.data.ui.product_sublanding.guide_types[typeKey] : null
9-
return {
10-
...renderedProps,
11-
type: { key: typeKey, value: typeVal },
12-
topics
13-
}
5+
linkAsArticleCard.renderPageProps = async function renderPageProps (page, ctx, props) {
6+
const renderedProps = await link().renderPageProps(page, ctx, props)
7+
const { type: typeKey, topics = [] } = page
8+
const typeVal = typeKey ? ctx.site.data.ui.product_sublanding.guide_types[typeKey] : null
9+
return {
10+
...renderedProps,
11+
type: { key: typeKey, value: typeVal },
12+
topics
1413
}
1514
}
15+
16+
module.exports = linkAsArticleCard

lib/liquid-tags/link-in-list.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
const Link = require('./link')
2-
3-
// For details, see class method in lib/liquid-tags/link.js
4-
module.exports = class LinkInList extends Link {}
1+
const link = require('./link')
2+
module.exports = link('link-in-list')

0 commit comments

Comments
 (0)