mirror of
https://gitee.com/huanghongxun/HMCL-docs.git
synced 2026-11-30 11:38:27 +08:00
refactor: refactor to 11ty to support Tencent Cloud EdgeOne Maker
continuous-integration/drone/push Build is failing
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import Eleventy from '@11ty/eleventy';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const arg=process.argv.indexOf('--output');
|
||||
const out=arg<0?'_site':process.argv[arg+1];
|
||||
const absolute=path.resolve(out);
|
||||
if(absolute!==path.resolve('_site')&&!absolute.startsWith(path.resolve('.cache')+path.sep))throw Error('Output must be _site or inside .cache');
|
||||
fs.rmSync(absolute,{recursive:true,force:true});
|
||||
const engine=new Eleventy('_eleventy',out,{configPath:'eleventy.config.js'});
|
||||
await engine.write();
|
||||
Reference in New Issue
Block a user