Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/llms-txt-hub / turbo/generators/config.ts |
| Date | Not specified in source |
| Repository | Janady13/llms-txt-hub |
| Revision | e0f4bf978d4df168369c7601d9c5f5ea89e84377 |
| Branch | main |
| Path or archive member | turbo/generators/config.ts |
| Original SHA-256 | bc18788c38c6f8528c3850f57ae5c7b6a4eecd93d9e58dcb4b6e888fbe429852 |
| Git blob SHA | 143549a506ae54842fe8d4a91560ac02d706d869 |
| Reading-copy SHA-256 | bc18788c38c6f8528c3850f57ae5c7b6a4eecd93d9e58dcb4b6e888fbe429852 |
Recovered source transcript
Download complete source text ↓89 lines · 2.3 KB
import type { PlopTypes } from '@turbo/gen'
const CATEGORIES = [
'integration-automation',
'developer-tools',
'ai-ml',
'data-analytics',
'security-identity',
'infrastructure-cloud',
'personal-sites'
] as const
/**
* Generator for creating new website MDX files
*
* @param plop - Plop API instance
* @returns void
*/
export default function generator(plop: PlopTypes.NodePlopAPI): void {
// Add helper for current date in YYYY-MM-DD format
plop.setHelper('currentDate', () => {
const date = new Date()
return date.toISOString().split('T')[0]
})
plop.setGenerator('website', {
description: 'Generate a new website entry',
prompts: [
{
type: 'input',
name: 'name',
message: 'What is the name of the website/tool?',
validate: (value: string) => {
if (!value) return 'Name is required'
return true
}
},
{
type: 'input',
name: 'description',
message: 'Provide a brief description:',
validate: (value: string) => {
if (!value) return 'Description is required'
return true
}
},
{
type: 'input',
name: 'website',
message: 'Enter the website URL:',
validate: (value: string) => {
if (!value) return 'Website URL is required'
if (!value.startsWith('https://')) return 'Website URL must start with https://'
return true
}
},
{
type: 'input',
name: 'llmsUrl',
message: 'Enter the URL to the llms.txt file:',
validate: (value: string) => {
if (!value) return 'llms.txt URL is required'
if (!value.startsWith('https://')) return 'URL must start with https://'
return true
}
},
{
type: 'input',
name: 'llmsFullUrl',
message: 'Enter the URL to the full llms.txt file:'
},
{
type: 'list',
name: 'category',
message: 'Select the category:',
choices: CATEGORIES,
default: 'integration-automation'
}
],
actions: [
{
type: 'add',
path: 'packages/content/data/websites/{{dashCase name}}-llms-txt.mdx',
templateFile: 'templates/mdx.hbs'
}
]
})
}