1
0
mirror of synced 2026-01-09 06:03:09 -05:00

Merge pull request #29567 from github/repo-sync

Repo sync
This commit is contained in:
docs-bot
2023-10-30 12:03:41 -04:00
committed by GitHub
3 changed files with 22 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ export function correctTranslatedContentStrings(content, englishContent, context
if (context.code === 'ru') {
// We've seen a lot of these in the Russian translations:
content = content.replaceAll('{% данных variables', '{% data variables')
content = content.replaceAll('{% variables.', '{% data variables.')
// For the rather custom Russian translation of
// the content/get-started/quickstart/github-glossary.md page

View File

@@ -1031,7 +1031,13 @@ function getRetryAfterSleep(headerValue) {
}
function checkImageSrc(src, $) {
if (!src.startsWith('/') && !src.startsWith('http')) {
return { CRITICAL: 'Image path is not absolute. Should start with a /' }
}
const pathname = new URL(src, 'http://example.com').pathname
if (pathname.startsWith('http://')) {
return { CRITICAL: "Don't use insecure HTTP:// for external images" }
}
if (!pathname.startsWith('/')) {
return { WARNING: "External images can't not be checked" }
}

View File

@@ -339,9 +339,22 @@ async function indexVersion(client, indexName, version, language, sourceDirector
mappings: {
properties: {
url: { type: 'keyword' },
title: { type: 'text', analyzer: 'text_analyzer', norms: false },
title: {
type: 'text',
analyzer: 'text_analyzer',
norms: false,
// This is used for fast highlighting. Uses more space but makes
// the searches faster.
term_vector: 'with_positions_offsets',
},
title_explicit: { type: 'text', analyzer: 'text_analyzer_explicit', norms: false },
content: { type: 'text', analyzer: 'text_analyzer' },
content: {
type: 'text',
analyzer: 'text_analyzer',
// This is used for fast highlighting. Uses more space but makes
// the searches faster.
term_vector: 'with_positions_offsets',
},
content_explicit: { type: 'text', analyzer: 'text_analyzer_explicit' },
headings: { type: 'text', analyzer: 'text_analyzer', norms: false },
headings_explicit: { type: 'text', analyzer: 'text_analyzer_explicit', norms: false },