1
0
mirror of synced 2026-01-02 21:04:32 -05:00

Merge pull request #18588 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2022-06-13 08:35:46 -05:00
committed by GitHub
3 changed files with 17 additions and 1 deletions

View File

@@ -56,6 +56,8 @@ jobs:
# The default is 10s. But because this runs overnight, we can
# be a lot more patient.
REQUEST_TIMEOUT: 20000
# Don't care about CDN caching image URLs
DISABLE_REWRITE_ASSET_URLS: true
# The default is 300 which works OK on a fast macbook pro
# but so well in Actions.
LINKINATOR_CONCURRENCY: 100

View File

@@ -49,6 +49,9 @@ jobs:
run: cat $HOME/files.json
- name: Link check (warnings, changed files)
env:
# Don't care about CDN caching image URLs
DISABLE_REWRITE_ASSET_URLS: true
run: |
./script/rendered-content-link-checker.mjs \
--language en \
@@ -59,6 +62,9 @@ jobs:
--list $HOME/files.json
- name: Link check (critical, all files)
env:
# Don't care about CDN caching image URLs
DISABLE_REWRITE_ASSET_URLS: true
run: |
./script/rendered-content-link-checker.mjs \
--language en \

View File

@@ -25,6 +25,14 @@ import wrapInElement from './plugins/wrap-in-element.js'
import doctocatLinkIcon from './doctocat-link-icon.js'
const graphql = HighlightjsGraphql.definer
// The rewrite-asset-urls plugin is nice because it makes the `<img src=...>`
// tags use unique URLs so they can be aggressively cached in the
// CDN. But it might not always make sense to bother. For example, in
// some CI where you're rendering lots of content and don't care
// about aggressive CDN caching at all. E.g. Actions that do link checking
// on rendered HTML.
const DISABLE_REWRITE_ASSET_URLS = JSON.parse(process.env.DISABLE_REWRITE_ASSET_URLS || 'false')
export default function createProcessor(context) {
return unified()
.use(process.env.COMMONMARK ? markdownNext : markdown)
@@ -46,7 +54,7 @@ export default function createProcessor(context) {
.use(raw)
.use(rewriteLegacyAssetPaths, context)
.use(wrapInElement, { selector: 'ol > li img', wrapper: 'span.procedural-image-wrapper' })
.use(rewriteImgSources)
.use(DISABLE_REWRITE_ASSET_URLS ? null : rewriteImgSources)
.use(rewriteLocalLinks, {
languageCode: context.currentLanguage,
version: context.currentVersion,