@@ -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',
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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.',
|
||||
},
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user