1
0
mirror of synced 2025-12-21 19:06:49 -05:00

Getting started category landing page (#17841)

* Start building out landing page in index file

* Add articles

* Add a couple more popular articles

* Tweak intro to cover more audiences

* Add TOC back with new organization

* Update content/github/getting-started-with-github/index.md

* Category as product guides section

* Update breadcrumbs.js

* Update server.js

* Update product-landing.html

* Remove TOC listing

* Revert removing TOC

* Update index.md

* Update index.md

* Update content/github/getting-started-with-github/index.md

* Apply suggestions from code review

Co-authored-by: Laura Coursen <lecoursen@github.com>

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
Co-authored-by: Laura Coursen <lecoursen@github.com>
This commit is contained in:
Emily Gould
2021-03-09 10:04:45 -06:00
committed by GitHub
parent 9d664ffdb5
commit 052a540cdb
8 changed files with 120 additions and 24 deletions

View File

@@ -90,6 +90,22 @@ function getProductStringFromPath (href) {
: pathParts[1]
}
function getCategoryStringFromPath (href) {
href = getPathWithoutLanguage(href)
if (href === '/') return null
const pathParts = href.split('/')
if (pathParts.includes('early-access')) return null
const productIndex = allProducts[pathParts[2]]
? 2
: 1
return pathParts[productIndex + 1]
}
// Return the corresponding object for the product segment in a path
function getProductObjectFromPath (href) {
const productFromPath = getProductStringFromPath(href)
@@ -104,5 +120,6 @@ module.exports = {
getVersionStringFromPath,
getVersionObjectFromPath,
getProductStringFromPath,
getCategoryStringFromPath,
getProductObjectFromPath
}