mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -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 {
|
import {
|
||||||
categories,
|
categories,
|
||||||
getKindToCategorySlug,
|
getKindToCategorySlug,
|
||||||
|
getCategoryKindName,
|
||||||
makeCategoryFilterFromCategorySlug
|
makeCategoryFilterFromCategorySlug
|
||||||
} from '~/helpers/categories.js'
|
} 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
|
// Clean up unused kind data
|
||||||
const kindPage = {
|
const kindPage = {
|
||||||
|
|
@ -47,7 +52,7 @@ const kindPage = {
|
||||||
let pageLabel = 'Mac Apps'
|
let pageLabel = 'Mac Apps'
|
||||||
const baseFilters = []
|
const baseFilters = []
|
||||||
|
|
||||||
const categorySlug = getKindToCategorySlug( pathSlug )
|
const categorySlug = getKindToCategorySlug( kindName )
|
||||||
|
|
||||||
// If we have a category slug, add a filter
|
// If we have a category slug, add a filter
|
||||||
if ( !!categorySlug ) {
|
if ( !!categorySlug ) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue