mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Generate kind index with app names
This commit is contained in:
parent
aeedb6d2e3
commit
8fcddd72ac
1 changed files with 20 additions and 2 deletions
|
|
@ -18,7 +18,10 @@ import getListSummaryNumbers from '~/helpers/get-list-summary-numbers.js'
|
||||||
import { videosRelatedToApp } from '~/helpers/related.js'
|
import { videosRelatedToApp } from '~/helpers/related.js'
|
||||||
import { buildVideoPayload, buildAppBenchmarkPayload } from '~/helpers/build-payload.js'
|
import { buildVideoPayload, buildAppBenchmarkPayload } from '~/helpers/build-payload.js'
|
||||||
|
|
||||||
import { categories, getAppCategory } from '~/helpers/categories.js'
|
import {
|
||||||
|
categories,
|
||||||
|
makeSummaryOfListings
|
||||||
|
} from '~/helpers/categories.js'
|
||||||
import {
|
import {
|
||||||
getAppType,
|
getAppType,
|
||||||
getAppEndpoint,
|
getAppEndpoint,
|
||||||
|
|
@ -374,7 +377,7 @@ class BuildLists {
|
||||||
}).flat()
|
}).flat()
|
||||||
}
|
}
|
||||||
|
|
||||||
saveKinds = async function () {
|
async saveKinds () {
|
||||||
|
|
||||||
const kindLists = this.makeKindLists()
|
const kindLists = this.makeKindLists()
|
||||||
|
|
||||||
|
|
@ -402,6 +405,21 @@ class BuildLists {
|
||||||
console.log( '\n\n' )
|
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 ) => {
|
saveApiEndpoints = async ( listOptions ) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue