1
0
mirror of synced 2026-01-08 21:02:10 -05:00

Merge pull request #32985 from github/repo-sync

Repo sync
This commit is contained in:
docs-bot
2024-05-15 14:30:03 -07:00
committed by GitHub
4 changed files with 11 additions and 1 deletions

View File

@@ -94,6 +94,7 @@ type SendEventProps = {
[EventType.link]: {
link_url: string
link_samesite?: boolean
link_samepage?: boolean
link_container?: string
}
[EventType.page]: {}
@@ -377,6 +378,7 @@ function initLinkEvent() {
type: EventType.link,
link_url: link.href,
link_samesite: sameSite,
link_samepage: sameSite && link.pathname === location.pathname,
link_container: container?.dataset.container,
})
})
@@ -389,6 +391,9 @@ function initLinkEvent() {
sendEvent({
type: EventType.link,
link_url: `${url}#scroll-to-top`,
link_samesite: true,
link_samepage: true,
link_container: 'static',
})
})
}

View File

@@ -253,6 +253,10 @@ const link = {
type: 'boolean',
description: 'If the link stays on docs.github.com.',
},
link_samepage: {
type: 'boolean',
description: 'If the link stays on the same page (hash link).',
},
link_container: {
type: 'string',
enum: [
@@ -265,6 +269,7 @@ const link = {
'article',
'toc',
'footer',
'static',
],
description: 'The part of the page where the user clicked the link.',
},

View File

@@ -27,7 +27,7 @@ import findPage from './find-page.js'
import blockRobots from './block-robots.js'
import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets.js'
import api from './api.js'
import healthz from './healthz.js'
import healthz from './healthz'
import productIcons from './product-icons.js'
import manifestJson from './manifest-json.js'
import remoteIP from './remote-ip.js'