Skip to content

Commit 6cf94e2

Browse files
authored
repo sync
2 parents 262a741 + 04f074a commit 6cf94e2

6 files changed

Lines changed: 24 additions & 66 deletions

File tree

content/github/administering-a-repository/about-dependabot-version-updates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: About Dependabot version updates
33
intro: 'You can use {% data variables.product.prodname_dependabot %} to keep the packages you use updated to the latest versions.'
44
redirect_from:
55
- /github/administering-a-repository/about-dependabot
6+
- /github/administering-a-repository/about-github-dependabot
67
- /github/administering-a-repository/about-github-dependabot-version-updates
78

89
versions:

data/reusables/enterprise-accounts/payment-information-tab.md renamed to data/reusables/enterprise-accounts/payment-information-tab.md

File renamed without changes.

lib/page.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
const assert = require('assert')
2-
const fs = require('fs')
32
const path = require('path')
43
const cheerio = require('cheerio')
54
const patterns = require('./patterns')
65
const getMapTopicContent = require('./get-map-topic-content')
76
const getApplicableVersions = require('./get-applicable-versions')
8-
const encodeBracketedParentheses = require('./encode-bracketed-parentheses')
97
const generateRedirectsForPermalinks = require('./redirects/permalinks')
108
const getEnglishHeadings = require('./get-english-headings')
119
const getTocItems = require('./get-toc-items')
@@ -14,11 +12,10 @@ const Permalink = require('./permalink')
1412
const languages = require('./languages')
1513
const renderContent = require('./render-content')
1614
const { renderReact } = require('./react/engine')
17-
const frontmatter = require('./frontmatter')
1815
const products = require('./all-products')
1916
const slash = require('slash')
2017
const statsd = require('./statsd')
21-
const fmfromf = require('./read-frontmatter')
18+
const readFileContents = require('./read-file-contents')
2219
const getLinkData = require('./get-link-data')
2320
const union = require('lodash/union')
2421

@@ -40,7 +37,7 @@ class Page {
4037
// Per https://nodejs.org/api/fs.html#fs_fs_exists_path_callback
4138
// its better to read and handle errors than to check access/stats first
4239
try {
43-
const { data, content, errors: frontmatterErrors } = await fmfromf(fullPath, opts.languageCode)
40+
const { data, content, errors: frontmatterErrors } = await readFileContents(fullPath, opts.languageCode)
4441

4542
return {
4643
...opts,
@@ -138,20 +135,7 @@ class Page {
138135
: this.renderProp('title', context, opts)
139136
}
140137

141-
async getMarkdown () {
142-
const raw = fs.readFileSync(this.fullPath, 'utf8')
143-
const { content } = frontmatter(raw, { filepath: this.fullPath })
144-
// prevent `[foo] (bar)` strings with a space between from being interpreted as markdown links
145-
const encodedMarkdown = encodeBracketedParentheses(content)
146-
return encodedMarkdown
147-
}
148-
149138
async _render (context) {
150-
// Get the raw markdown if we need to
151-
if (!this.markdown) {
152-
this.markdown = await this.getMarkdown()
153-
}
154-
155139
// use English IDs/anchors for translated headings, so links don't break (see #8572)
156140
if (this.languageCode !== 'en') {
157141
const englishHeadings = getEnglishHeadings(this, context.pages)

lib/read-file-contents.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const fs = require('fs')
2+
const encodeBracketedParentheses = require('./encode-bracketed-parentheses')
3+
const fm = require('./frontmatter')
4+
5+
/**
6+
* Read only the frontmatter from file
7+
*/
8+
module.exports = async function fmfromf (filepath, languageCode) {
9+
let fileContent = await fs.promises.readFile(filepath, 'utf8')
10+
11+
fileContent = encodeBracketedParentheses(fileContent)
12+
13+
// TODO remove this when crowdin-support issue 66 has been resolved
14+
if (languageCode !== 'en' && fileContent.includes(': verdadero')) {
15+
fileContent = fileContent.replace(': verdadero', ': true')
16+
}
17+
18+
return fm(fileContent, { filepath })
19+
}

lib/read-frontmatter.js

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

tests/rendering/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,9 @@ describe('server', () => {
483483

484484
describe('URLs by language', () => {
485485
// TODO re-enable this test once TOCs are auto-generated (after PR 11731 has landed)
486-
test.skip('heading IDs and links on translated pages are in English', async () => {
486+
test('heading IDs and links on translated pages are in English', async () => {
487487
const $ = await getDOM('/ja/github/getting-started-with-github/verifying-your-email-address')
488+
expect($.res.statusCode).toBe(200)
488489
expect($('h3[id="further-reading"]').length).toBe(1)
489490
expect($('h3[id="参考リンク"]').length).toBe(0)
490491
expect($('h3 a[href="#further-reading"]').length).toBe(1)

0 commit comments

Comments
 (0)