Move makeSlug to function

This commit is contained in:
Sam Carlton 2021-04-17 22:36:06 -05:00
parent d1cb178be1
commit 00f1f1397c
5 changed files with 17 additions and 30 deletions

View file

@ -1,7 +1,6 @@
import { promises as fs } from 'fs'
import MarkdownIt from 'markdown-it'
import slugify from 'slugify'
import axios from 'axios'
import statuses, { getStatusName } from './statuses'
@ -9,17 +8,11 @@ import appStoreGenres from './app-store/genres.js'
import parseDate from './parse-date'
import { eitherMatches } from './matching.js'
import { getAppEndpoint } from './app-derived'
import { makeSlug } from './slug.js'
const md = new MarkdownIt()
const makeSlug = name => slugify(name, {
lower: true,
strict: true
})
const getTokenLinks = function ( childTokens ) {
const tokenList = []
@ -264,10 +257,7 @@ export default async function () {
if (isHeading && token.type === 'inline') {
categoryTitle = token.content
categorySlug = slugify(token.content, {
lower: true,
strict: true
})
categorySlug = makeSlug( token.content )
// appList[categorySlug] = []
}