1
0
Fork 0
freesewing/config/software/index.mjs
Joost De Cock 469eb43c95
feat: Add various content types to docusaurus (#7231)
This brings blog posts, showcase posts, and newsletter editions into the Docusaurus site.

It also adds support for using TailwindCSS inside a container. So this will probably end up being the new freesewing.org site in v4.
2024-11-18 11:05:16 +01:00

41 lines
1.1 KiB
JavaScript

import designs from './designs.json' assert { type: 'json' }
import packages from './packages.json' assert { type: 'json' }
import plugins from './plugins.json' assert { type: 'json' }
// Helper method to construct summary objects
const unpack = (obj, folder) =>
Object.fromEntries(
Object.keys(obj).map((name) => [
name,
{ name, folder, type: folder.slice(0, -1), description: obj[name] },
])
)
// Helper method to construct summary objects for designs
const unpackDesigns = (obj, folder) =>
Object.fromEntries(
Object.keys(obj).map((name) => [
name,
{ name, folder, type: folder.slice(0, -1), ...obj[name] },
])
)
// Re-Export imported JSON
export { designs, packages, plugins }
// All software
export const software = {
...unpackDesigns(designs, 'designs'),
...unpack(plugins, 'plugins'),
...unpack(packages, 'packages'),
}
// All software published on NPM
export const publishedSoftware = {
...unpackDesigns(designs, 'designs'),
...unpack(plugins, 'plugins'),
...unpack(packages, 'packages'),
}
export const publishedTypes = ['designs', 'packages', 'plugins']
export const types = publishedTypes