mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Add support for category slugs on kind template
This commit is contained in:
parent
562609abc9
commit
23a4c300cb
1 changed files with 7 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import { catchRedirectResponse } from '~/helpers/astro/request.js'
|
|||
import {
|
||||
categories,
|
||||
getKindToCategorySlug,
|
||||
getCategoryKindName,
|
||||
makeCategoryFilterFromCategorySlug
|
||||
} from '~/helpers/categories.js'
|
||||
|
||||
|
|
@ -33,7 +34,11 @@ if ( redirectResponse !== null ) {
|
|||
}
|
||||
|
||||
|
||||
const rawKindPage = await DoesItAPI.kind( pathSlug )( subSlug ).get()
|
||||
// Try the pathSlug against categories
|
||||
// so we can load from category slugs
|
||||
const kindName = getCategoryKindName( pathSlug ) ? getCategoryKindName( pathSlug ) : pathSlug
|
||||
|
||||
const rawKindPage = await DoesItAPI.kind( kindName )( subSlug ).get()
|
||||
|
||||
// Clean up unused kind data
|
||||
const kindPage = {
|
||||
|
|
@ -47,7 +52,7 @@ const kindPage = {
|
|||
let pageLabel = 'Mac Apps'
|
||||
const baseFilters = []
|
||||
|
||||
const categorySlug = getKindToCategorySlug( pathSlug )
|
||||
const categorySlug = getKindToCategorySlug( kindName )
|
||||
|
||||
// If we have a category slug, add a filter
|
||||
if ( !!categorySlug ) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue