1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| import type Hexo from '../../hexo';
export = function (ctx: Hexo) { const { console } = ctx.extend;
console.register('clean', 'Remove generated files and cache.', require('./clean'));
console.register('config', 'Get or set configurations.', { usage: '[name] [value]', arguments: [ { name: 'name', desc: 'Setting name. Leave it blank if you want to show all configurations.' }, { name: 'value', desc: 'New value of a setting. Leave it blank if you just want to show a single configuration.' } ] }, require('./config'));
console.register('deploy', 'Deploy your website.', { options: [ { name: '--setup', desc: 'Setup without deployment' }, { name: '-g, --generate', desc: 'Generate before deployment' } ] }, require('./deploy'));
console.register('generate', 'Generate static files.', { options: [ { name: '-d, --deploy', desc: 'Deploy after generated' }, { name: '-f, --force', desc: 'Force regenerate' }, { name: '-w, --watch', desc: 'Watch file changes' }, { name: '-b, --bail', desc: 'Raise an error if any unhandled exception is thrown during generation' }, { name: '-c, --concurrency', desc: 'Maximum number of files to be generated in parallel. Default is infinity' } ] }, require('./generate'));
console.register('list', 'List the information of the site', { desc: 'List the information of the site.', usage: '<type>', arguments: [ { name: 'type', desc: 'Available types: page, post, route, tag, category' } ] }, require('./list'));
console.register('migrate', 'Migrate your site from other system to Hexo.', { init: true, usage: '<type>', arguments: [ { name: 'type', desc: 'Migrator type.' } ] }, require('./migrate'));
console.register('new', 'Create a new post.', { usage: '[layout] <title>', arguments: [ { name: 'layout', desc: 'Post layout. Use post, page, draft or whatever you want.' }, { name: 'title', desc: 'Post title. Wrap it with quotations to escape.' } ], options: [ { name: '-r, --replace', desc: 'Replace the current post if existed.' }, { name: '-s, --slug', desc: 'Post slug. Customize the URL of the post.' }, { name: '-p, --path', desc: 'Post path. Customize the path of the post.' } ] }, require('./new'));
console.register('publish', 'Moves a draft post from _drafts to _posts folder.', { usage: '[layout] <filename>', arguments: [ { name: 'layout', desc: 'Post layout. Use post, page, draft or whatever you want.' }, { name: 'filename', desc: 'Draft filename. "hello-world" for example.' } ] }, require('./publish'));
console.register('render', 'Render files with renderer plugins.', { init: true, desc: 'Render files with renderer plugins (e.g. Markdown) and save them at the specified path.', usage: '<file1> [file2] ...', options: [ { name: '--output', desc: 'Output destination. Result will be printed in the terminal if the output destination is not set.' }, { name: '--engine', desc: 'Specify render engine' }, { name: '--pretty', desc: 'Prettify JSON output' } ] }, require('./render')); }
|