Rename sections to categories

This commit is contained in:
Sam Carlton 2020-11-28 15:16:56 -06:00
parent e578118bab
commit fd63c02e2a
8 changed files with 56 additions and 58 deletions

View file

@ -128,8 +128,8 @@ export default async function () {
const appList = []
let sectionSlug = 'start'
let sectionTitle = 'Start'
let categorySlug = 'start'
let categoryTitle = 'Start'
let isHeading = false
let isParagraph = false
@ -143,13 +143,13 @@ export default async function () {
if (isHeading && token.type === 'inline') {
sectionTitle = token.content
sectionSlug = slugify(token.content, {
categoryTitle = token.content
categorySlug = slugify(token.content, {
lower: true,
strict: true
})
// appList[sectionSlug] = []
// appList[categorySlug] = []
}
@ -192,15 +192,15 @@ export default async function () {
text,
slug: appSlug,
endpoint,
section: {
slug: sectionSlug
category: {
slug: categorySlug
},
content: token.content,
relatedLinks
})
}
// appList[sectionSlug]
// appList[categorySlug]
// console.log('token', token)

View file

@ -123,7 +123,7 @@ export default async function () {
text: getStatusText(game),
slug,
endpoint: `/game/${slug}`,
section: {
category: {
slug: 'games'
},
content: '',

View file

@ -149,7 +149,7 @@ export default async function () {
text: getStatusText(formulae),
slug,
endpoint: `/formula/${slug}`,
section: {
category: {
slug: 'homebrew'
},
content: formulae.comments,

View file

@ -86,5 +86,8 @@ export const categories = {
export function getAppCategory (app) {
return categories[app.section.slug]
if (typeof app.category === 'undefined') {
console.log('app', app)
}
return categories[app.category.slug]
}