MCPcopy Index your code
hub / github.com/github/docs / getLanguageVariants

Method getLanguageVariants

lib/page.js:299–310  ·  view source on GitHub ↗
(href)

Source from the content-addressed store, hash-verified

297 // given a page path, return an array of objects containing hrefs
298 // for that page in all languages
299 static getLanguageVariants(href) {
300 const suffix = pathUtils.getPathWithoutLanguage(href)
301 return Object.values(languages).map(({ name, code, hreflang }) => {
302 // eslint-disable-line
303 return {
304 name,
305 code,
306 hreflang,
307 href: `/${code}${suffix}`.replace(patterns.trailingSlash, '$1'),
308 }
309 })
310 }
311}
312
313export default Page

Callers 2

renderPageFunction · 0.80
page.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected