Generate kind index with app names

This commit is contained in:
Sam Carlton 2022-05-25 13:24:16 -05:00
parent aeedb6d2e3
commit 8fcddd72ac

View file

@ -18,7 +18,10 @@ import getListSummaryNumbers from '~/helpers/get-list-summary-numbers.js'
import { videosRelatedToApp } from '~/helpers/related.js'
import { buildVideoPayload, buildAppBenchmarkPayload } from '~/helpers/build-payload.js'
import { categories, getAppCategory } from '~/helpers/categories.js'
import {
categories,
makeSummaryOfListings
} from '~/helpers/categories.js'
import {
getAppType,
getAppEndpoint,
@ -374,7 +377,7 @@ class BuildLists {
}).flat()
}
saveKinds = async function () {
async saveKinds () {
const kindLists = this.makeKindLists()
@ -402,6 +405,21 @@ class BuildLists {
console.log( '\n\n' )
}
const kindIndex = categories
// Delete no-category
delete kindIndex['no-category']
// Store sample names into kindIndex as description
for ( const categorySlug in kindIndex ) {
kindIndex[categorySlug].description = kindLists[categorySlug].summary.sampleNames
}
console.log( 'kindIndex', kindIndex )
// Save the index
await this.saveToJson( kindIndex, `${ apiDirectory }/kind/index.json` )
}
saveApiEndpoints = async ( listOptions ) => {