mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Rename sections to categories
This commit is contained in:
parent
e578118bab
commit
fd63c02e2a
8 changed files with 56 additions and 58 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ export default async function () {
|
|||
text: getStatusText(game),
|
||||
slug,
|
||||
endpoint: `/game/${slug}`,
|
||||
section: {
|
||||
category: {
|
||||
slug: 'games'
|
||||
},
|
||||
content: '',
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default async function () {
|
|||
text: getStatusText(formulae),
|
||||
slug,
|
||||
endpoint: `/formula/${slug}`,
|
||||
section: {
|
||||
category: {
|
||||
slug: 'homebrew'
|
||||
},
|
||||
content: formulae.comments,
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue