Skip to content

Commit 18154fa

Browse files
authored
Merge pull request #39025 from github/repo-sync
Repo sync
2 parents cf719e5 + 2cb450d commit 18154fa

File tree

5 files changed

+8
-31
lines changed

5 files changed

+8
-31
lines changed

content/contributing/collaborating-on-github-docs/using-the-content-linter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Some linting rules return warnings or errors based on HTML comments that you can
118118

119119
#### Syntax for expiring and expired content
120120

121-
Rules `GHD038` and `GHD039` check for content that has been manually given an expiration date. Fourteen days before the specified date, the content linter will return a warning that the content is expiring soon. Starting on the specified date, the content linter will return an error and flag the content for remediation.
121+
Rules `GHD038` and `GHD039` check for content that has been manually given an expiration date. Fourteen days before the specified date, the content linter will return a warning that the content is expiring soon. Starting on the specified date, the content linter will return a warning and flag the content for remediation.
122122

123123
You can add an expiration date to content by wrapping it in HTML tags that contain an expiration date in the format: `<!-- expires yyyy-mm-dd --> <!-- end expires yyyy-mm-dd -->`
124124

data/reusables/contributing/content-linter-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
| GHD022 | liquid-ifversion-versions | Liquid `ifversion`, `elsif`, and `else` tags should be valid and not contain unsupported versions. | error | liquid, versioning |
6060
| GHD035 | rai-reusable-usage | RAI articles and reusables can only reference reusable content in the data/reusables/rai directory | error | feature, rai |
6161
| GHD036 | image-no-gif | Image must not be a gif, styleguide reference: contributing/style-guide-and-content-model/style-guide.md#images | error | images |
62-
| GHD038 | expired-content | Expired content must be remediated. | error | expired |
62+
| GHD038 | expired-content | Expired content must be remediated. | warning | expired |
6363
| GHD039 | expiring-soon | Content that expires soon should be proactively addressed. | warning | expired |
6464
| [GHD040](https://github.com/github/docs/blob/main/src/content-linter/README.md) | table-liquid-versioning | Tables must use the correct liquid versioning format | error | tables |
6565
| GHD041 | third-party-action-pinning | Code examples that use third-party actions must always pin to a full length commit SHA | error | feature, actions |

src/content-linter/style/github-docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const githubDocsConfig = {
137137
},
138138
'expired-content': {
139139
// GHD038
140-
severity: 'error',
140+
severity: 'warning',
141141
'partial-markdown-files': true,
142142
},
143143
'expiring-soon': {

src/content-linter/tests/category-pages.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe.skip('category pages', () => {
8383
let publishedArticlePaths: string[] = []
8484
let availableArticlePaths: string[] = []
8585
let categoryVersions: string[] = []
86-
let categoryChildTypes: string[] = []
86+
8787
let allowTitleToDifferFromFilename: boolean | undefined = false
8888
let indexTitle: string = ''
8989
let indexShortTitle: string = ''
@@ -101,23 +101,9 @@ describe.skip('category pages', () => {
101101
const data = parsed.data as MarkdownFrontmatter
102102
categoryVersions = getApplicableVersions(data.versions, indexAbsPath)
103103
allowTitleToDifferFromFilename = data.allowTitleToDifferFromFilename
104-
categoryChildTypes = []
105104
const articleLinks = data.children.filter((child) => {
106105
const mdPath = getPath(productDir, indexLink, child)
107-
108106
const fileExists = fs.existsSync(mdPath)
109-
110-
// We're checking each item in the category's 'children' frontmatter
111-
// to see if the child is an article by tacking on `.md` to it. If
112-
// that file exists it's an article, otherwise it's a map topic. A
113-
// category needs to have all the same type of children so we track
114-
// that here so we can test to make sure all the types are the same.
115-
if (fileExists) {
116-
categoryChildTypes.push('article')
117-
} else {
118-
categoryChildTypes.push('mapTopic')
119-
}
120-
121107
return fileExists && fs.statSync(mdPath).isFile()
122108
})
123109

@@ -217,19 +203,6 @@ describe.skip('category pages', () => {
217203
})
218204
})
219205

220-
test('categories contain all the same type of children', () => {
221-
let errorType = ''
222-
expect(
223-
categoryChildTypes.every((categoryChildType) => {
224-
errorType = categoryChildType
225-
return categoryChildType === categoryChildTypes[0]
226-
}),
227-
`${indexRelPath.replace('index.md', '')} contains a mix of ${errorType}s and ${
228-
categoryChildTypes[0]
229-
}s, category children must be of the same type`,
230-
).toBe(true)
231-
})
232-
233206
test('slugified title matches parent directory name', () => {
234207
if (allowTitleToDifferFromFilename) return
235208

src/search/components/results/Aggregations.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ export function SearchResultsAggregations({ aggregations }: Props) {
3030
} else {
3131
params.append('toplevel', toplevel)
3232
}
33+
// Reset pagination when filters change to prevent showing 0 results
34+
params.delete('page')
3335
return `/${locale}${asPathRoot}?${params}`
3436
}
3537

3638
function makeClearHref() {
3739
const [asPathRoot, asPathQuery = ''] = asPath.split('#')[0].split('?')
3840
const params = new URLSearchParams(asPathQuery)
3941
params.delete('toplevel')
42+
// Reset pagination when clearing filters
43+
params.delete('page')
4044
return `/${locale}${asPathRoot}?${params}`
4145
}
4246

0 commit comments

Comments
 (0)