valaxy 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-W5DOG5RZ.mjs → chunk-3CJLTSUY.mjs} +1 -1
- package/dist/{chunk-BJZFP6ZO.cjs → chunk-X57MD6QQ.cjs} +1 -1
- package/dist/node/cli.cjs +1 -1
- package/dist/node/cli.mjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.ts +82 -75
- package/package.json +1 -1
- package/types/posts.ts +87 -76
|
@@ -14,7 +14,7 @@ GFS4: `),console.error(e)});K[oe]||(na=global[oe]||[],oa(K,na),K.close=function(
|
|
|
14
14
|
`)+r,i=n+1,n=e.indexOf(`
|
|
15
15
|
`,i)}while(n!==-1);return o+=e.substr(i),o};Sm.exports={stringReplaceAll:GS,stringEncaseCRLFWithFirstIndex:WS}});var Fm=v((_F,km)=>{"use strict";var YS=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,wm=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,KS=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,zS=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,JS=new Map([["n",`
|
|
16
16
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Rm(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):JS.get(e)||e}function QS(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),i;for(let o of n){let s=Number(o);if(!Number.isNaN(s))r.push(s);else if(i=o.match(KS))r.push(i[2].replace(zS,(a,u,l)=>u?Rm(u):l));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`)}return r}function XS(e){wm.lastIndex=0;let t=[],r;for(;(r=wm.exec(e))!==null;){let n=r[1];if(r[2]){let i=QS(n,r[2]);t.push([n].concat(i))}else t.push([n])}return t}function Am(e,t){let r={};for(let i of t)for(let o of i.styles)r[o[0]]=i.inverse?null:o.slice(1);let n=e;for(let[i,o]of Object.entries(r))if(!!Array.isArray(o)){if(!(i in n))throw new Error(`Unknown Chalk style: ${i}`);n=o.length>0?n[i](...o):n[i]}return n}km.exports=(e,t)=>{let r=[],n=[],i=[];if(t.replace(YS,(o,s,a,u,l,c)=>{if(s)i.push(Rm(s));else if(u){let p=i.join("");i=[],n.push(r.length===0?p:Am(e,r)(p)),r.push({inverse:a,styles:XS(u)})}else if(l){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(Am(e,r)(i.join(""))),i=[],r.pop()}else i.push(c)}),n.push(i.join("")),r.length>0){let o=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(o)}return n.join("")}});var Im=v((EF,Mm)=>{"use strict";var kr=ym(),{stdout:Us,stderr:Gs}=bm(),{stringReplaceAll:ZS,stringEncaseCRLFWithFirstIndex:eC}=Cm(),{isArray:Wn}=Array,Pm=["ansi","ansi","ansi256","ansi16m"],Xt=Object.create(null),tC=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Us?Us.level:0;e.level=t.level===void 0?r:t.level},Ws=class{constructor(t){return Tm(t)}},Tm=e=>{let t={};return tC(t,e),t.template=(...r)=>Dm(t.template,...r),Object.setPrototypeOf(t,Yn.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=Ws,t.template};function Yn(e){return Tm(e)}for(let[e,t]of Object.entries(kr))Xt[e]={get(){let r=Kn(this,Ys(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};Xt.visible={get(){let e=Kn(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var $m=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of $m)Xt[e]={get(){let{level:t}=this;return function(...r){let n=Ys(kr.color[Pm[t]][e](...r),kr.color.close,this._styler);return Kn(this,n,this._isEmpty)}}};for(let e of $m){let t="bg"+e[0].toUpperCase()+e.slice(1);Xt[t]={get(){let{level:r}=this;return function(...n){let i=Ys(kr.bgColor[Pm[r]][e](...n),kr.bgColor.close,this._styler);return Kn(this,i,this._isEmpty)}}}}var rC=Object.defineProperties(()=>{},{...Xt,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),Ys=(e,t,r)=>{let n,i;return r===void 0?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},Kn=(e,t,r)=>{let n=(...i)=>Wn(i[0])&&Wn(i[0].raw)?Om(n,Dm(n,...i)):Om(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,rC),n._generator=e,n._styler=t,n._isEmpty=r,n},Om=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=ZS(t,r.close,r.open),r=r.parent;let o=t.indexOf(`
|
|
17
|
-
`);return o!==-1&&(t=eC(t,i,n,o)),n+t+i},Vs,Dm=(e,...t)=>{let[r]=t;if(!Wn(r)||!Wn(r.raw))return t.join(" ");let n=t.slice(1),i=[r.raw[0]];for(let o=1;o<r.length;o++)i.push(String(n[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return Vs===void 0&&(Vs=Fm()),Vs(e,i.join(""))};Object.defineProperties(Yn.prototype,Xt);var zn=Yn();zn.supportsColor=Us;zn.stderr=Yn({level:Gs?Gs.level:0});zn.stderr.supportsColor=Gs;Mm.exports=zn});var er=Q(Ae(),1);import Zt from"path";import{exec as mC}from"child_process";import hC from"yargs";import{mergeConfig as Ks}from"vite";import gC from"open";import Qn from"consola";import{yellow as yC}from"kolorist";import{hideBin as vC}from"yargs/helpers";var Hr="0.14.
|
|
17
|
+
`);return o!==-1&&(t=eC(t,i,n,o)),n+t+i},Vs,Dm=(e,...t)=>{let[r]=t;if(!Wn(r)||!Wn(r.raw))return t.join(" ");let n=t.slice(1),i=[r.raw[0]];for(let o=1;o<r.length;o++)i.push(String(n[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return Vs===void 0&&(Vs=Fm()),Vs(e,i.join(""))};Object.defineProperties(Yn.prototype,Xt);var zn=Yn();zn.supportsColor=Us;zn.stderr=Yn({level:Gs?Gs.level:0});zn.stderr.supportsColor=Gs;Mm.exports=zn});var er=Q(Ae(),1);import Zt from"path";import{exec as mC}from"child_process";import hC from"yargs";import{mergeConfig as Ks}from"vite";import gC from"open";import Qn from"consola";import{yellow as yC}from"kolorist";import{hideBin as vC}from"yargs/helpers";var Hr="0.14.2";import r1 from"net";async function gi(e){return await n1(e)?e:await gi(e+1)}function n1(e){return new Promise(t=>{let r=r1.createServer(n=>{n.write(`Echo server\r
|
|
18
18
|
`),n.pipe(n)});r.listen(e,"0.0.0.0"),r.on("error",()=>{t(!1)}),r.on("listening",()=>{r.close(),t(!0)})})}var jp=Q(Ae(),1),Hp=Q(Ei(),1),Vp=Q(bn(),1);import{dirname as HE,resolve as Fn}from"path";import{ensureSuffix as Bp,uniq as VE}from"@antfu/utils";function ns(e){return e!==null&&typeof e=="object"}function is(e,t,r=".",n){if(!ns(t))return is(e,{},r,n);let i=Object.assign({},t);for(let o in e){if(o==="__proto__"||o==="constructor")continue;let s=e[o];s!=null&&(n&&n(i,o,s,r)||(Array.isArray(s)&&Array.isArray(i[o])?i[o]=s.concat(i[o]):ns(s)&&ns(i[o])?i[o]=is(s,i[o],(r?`${r}.`:"")+o.toString(),n):i[o]=s))}return i}function mr(e){return(...t)=>t.reduce((r,n)=>is(r,n,"",e),{})}var $e=mr(),kw=mr((e,t,r,n)=>{if(typeof e[t]<"u"&&typeof r=="function")return e[t]=r(e[t]),!0}),Fw=mr((e,t,r,n)=>{if(Array.isArray(e[t])&&typeof r=="function")return e[t]=r(e[t]),!0});import{cyan as UE,yellow as GE}from"kolorist";import F_ from"consola";var os=()=>process.env.NODE_ENV==="production",ss=(e="development")=>{process.env.NODE_ENV=e,we.level=os()?2:3},hr=()=>ss("production");var we=F_.create({level:os()?2:3});var Tp=Q(bp(),1);import{join as Fp}from"path";import AE from"is-installed-globally";import Op from"global-dirs";import Pp from"consola";import{spawn as EE}from"cross-spawn";function _r(e,t="updated"){return new Promise((r,n)=>{let i=["log"];t==="updated"&&i.push("-1"),i.push('--pretty="%ci"',e),t==="created"&&i.push("|","tail","-1");let o=EE("git",i),s="";o.stdout.on("data",a=>s+=String(a)),o.on("close",()=>{r(+new Date(s))}),o.on("error",()=>{r(0)})})}var An="<!-- more -->",jt=/^https?:/i,Sp=/^pathname:\/\//;function Cp(e){return jt.test(e)}function it(e){return e.replace(/\\/g,"/")}function hs(e,t){return t.startsWith(e)?t:e+t}function te(e){return`/@fs${hs("/",it(e))}`}function wp(e){return e.startsWith("/")||/^\.\.?[\/\\]/.test(e)}import{mergeConfig as SE}from"vite";import{isFunction as Ap}from"@antfu/utils";import{cyan as CE,dim as wE}from"kolorist";import{loadConfig as xE}from"unconfig";import{normalizePath as bE}from"vite";async function vt(e,t={}){let{config:r,sources:n}=await await xE({sources:{files:e,rewrite:t.rewrite},cwd:t.cwd||process.cwd()}),i=bE(n[0]||"");return{config:r,configFile:i}}var Ht=mr((e,t,r)=>{if(Ap(e[t])&&Ap(r)&&(e[t]=function(...n){e[t].call(this,...n),r.call(this,...n)}),t==="vite")return e[t]=SE(e[t],r),!0});async function gs(e,t){return vt("valaxy.config",{rewrite(r){return typeof r=="function"?r(t||{}):r},cwd:e})}async function Rp(e){let{config:t,configFile:r}=await gs(e.userRoot||process.cwd());t&&we.info(`Resolve ${CE("valaxyConfig")} from ${wE(r)}`);let n=e.theme||t.theme||"yun";return{config:t,configFile:r,theme:n}}async function kp(e,t){let r={};for(let n of e){let{config:i,configFile:o}=await vt("index",{rewrite(s,a){return typeof s=="function"?s(n,t):s},cwd:n.root});!i||(n.configFile=o,r=Ht(i,r))}return r}var $p=e=>`JSON.parse(${JSON.stringify(JSON.stringify(e))})`;function Ge(e,t=!1,r={preserveSymlinks:!1}){try{return(0,Tp.sync)(e,r)}catch(n){Pp.log(n)}if(AE){try{return I.resolve(Fp(Op.yarn.packages,e))}catch{}try{return I.resolve(Fp(Op.npm.packages,e))}catch{}}if(t)throw new Error(`Failed to resolve package ${e}`);Pp.error(`Failed to resolve package ${e}`)}function RE(e){return e}var bA=RE;function kE(e){return e}var SA=kE;function wA(e){return e}function FE(e){return e}var AA=FE,ys={mode:"auto",url:"/",lang:"en",title:"Valaxy Blog",description:"A blog generated by Valaxy.",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://www.yunyoujun.cn/images/avatar.jpg",email:"i@valaxy.site",link:"https://valaxy.site",name:"VALAXY Developer",status:{emoji:"\u{1F30C}",message:"The moonlight is beautiful."}},favicon:"/favicon.svg",feed:{name:"",favicon:"/favicon.svg"},social:[],date:{format:""},lastUpdated:!0,license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u8D5E\u52A9",methods:[]},search:{enable:!1,type:"fuse"},comment:{enable:!1},cdn:{prefix:"https://unpkg.com/"},mediumZoom:{enable:!1,selector:"",options:{}}},Dp={ignoreDeadLinks:!0,siteConfig:ys,theme:"yun",themeConfig:{pkg:{name:"",version:""}},runtimeConfig:{addons:{}},features:{katex:!0},vite:{build:{rollupOptions:{external:[]}}}};function RA(e){return e}var vs=Q(Ae(),1);import{resolve as TE}from"path";import{cyan as $E,yellow as DE}from"kolorist";import{dirname as Mp,resolve as OE}from"path";import PE from"fs";function Rn(e,t){if(!e)return"";if(wp(e))if(t){let r=PE.lstatSync(t).isFile();return OE(r?Mp(t):t,e)}else throw new Error(`entry is required when ${e} is path`);else return Mp(Ge(`${e}/package.json`)||"")}async function Lp(e,t=process.cwd()){let r={},n=o=>{o&&(r[o.name]=$e(r[o.name]||{},o))};if(Array.isArray(e))for(let o of e){if(typeof o=="string"){n(await Ip(o,{cwd:t}));continue}typeof o=="object"&&n($e(await Ip(o.name,{cwd:t}),o||{}))}let i=Object.values(r).filter(o=>o.enable);return we.info(`Resolve ${$E("addons:")} ${DE(i.map(o=>o.name).join(", "))}`),i}async function Ip(e,t={}){let r=ME(e,t.cwd||process.cwd()),n=TE(r,"./package.json");if(!vs.default.existsSync(n)){we.error(`No addon named ${e} found`);return}let i=await vs.default.readJSON(n);return{enable:!0,name:i.name,global:!!i.global,root:r,options:{},props:{}}}function ME(e,t){let r=e.startsWith("valaxy-addon")||e.startsWith(".")?e:`valaxy-addon-${e}`;return Rn(r,t)}function Np(e,t){let r=e.startsWith("valaxy-theme")||e.startsWith(".")?e:`valaxy-theme-${e}`;return Rn(r,t)}import{cyan as IE,dim as LE}from"kolorist";async function NE(e){return vt("site.config",{cwd:e})}async function kn(e){let{config:t,configFile:r}=await NE(e);return t&&we.info(`Resolve ${IE("siteConfig")} from ${LE(r)}`),{siteConfig:t,siteConfigFile:r}}import{cyan as qE,dim as BE}from"kolorist";async function jE(e){return vt("theme.config",{cwd:e})}async function qp(e){let{config:t,configFile:r}=await jE(e);return t&&we.info(`Resolve ${qE("themeConfig")} from ${BE(r)}`),{themeConfig:t,themeConfigFile:r}}var WE=(0,Hp.default)("valaxy:options");async function YE(e){let{config:t,themeRoot:r,theme:n}=e,i=t.siteConfig;i.url=Bp("/",i.url||""),i.cdn.prefix=Bp("/",i.cdn.prefix||"");let o=Fn(r,"package.json");try{t.themeConfig.pkg=await jp.default.readJson(o,"utf-8")}catch{console.error(`valaxy-theme-${n} doesn't have package.json`)}}async function _s(e,t){let{clientRoot:r,themeRoot:n,userRoot:i}=e,o=await Lp(t.addons||[],e.userRoot),s=await kp(o,e);t=Ht(t,s);let a=$e(t,Dp);e.config={...a,runtimeConfig:{addons:{}}},e.addons=o,o.forEach(p=>{e.config.runtimeConfig.addons[p.name]=p});let u=o.map(({root:p})=>p),l=o.map(({name:p})=>p);e.addonRoots=u,e.roots=VE([r,n,...u,i]);let c=e.config.vite?.build?.rollupOptions?.external||[];return e.config.vite.build.rollupOptions.external=c.filter(p=>!l.includes(p)),await YE(e),e}async function De(e={userRoot:process.cwd()},t="dev"){let r=HE(Ge("valaxy/package.json",!0)),n=Fn(r,"client"),i=Fn(e.userRoot||process.cwd()),{config:o,configFile:s,theme:a}=await Rp(e),{siteConfig:u,siteConfigFile:l}=await kn(e.userRoot),{themeConfig:c,themeConfigFile:p}=await qp(e.userRoot);o=$e({siteConfig:u},{themeConfig:c},o);let f=Np(a,e.userRoot),y=(await(0,Vp.default)(["**.md"],{cwd:Fn(i,"pages"),ignore:["**/node_modules"]})).sort(),h={mode:t,pkgRoot:r,clientRoot:n,userRoot:i,themeRoot:f,addonRoots:[],roots:[],theme:a,config:{...o,runtimeConfig:{addons:{}}},configFile:s||"",siteConfigFile:l||"",themeConfigFile:p||"",pages:y,addons:[]};WE(h);let _=await Es(h),E=Ht(o,_);return h=await _s(h,E),h}async function Es(e){we.info(`Resolve ${UE("valaxy.config.ts")} from ${GE(`theme(${e.theme})`)}`);let{config:t}=await gs(e.themeRoot,e);return t}import*as Gd from"readline";import cS from"path";import lS from"os";import{blue as Vd,bold as $s,cyan as fS,dim as We,gray as pS,green as dS,underline as Ds,yellow as mS}from"kolorist";import Ud from"consola";import{mergeConfig as hS}from"vite";import{createServer as aS,mergeConfig as uS}from"vite";import Nn from"fs";import{splitVendorChunkPlugin as Qb}from"vite";import Xb from"markdown-it";import Zb from"gray-matter";import eS from"@vitejs/plugin-vue";import tS from"vite-plugin-pages";import rS from"vite-plugin-vue-layouts";import nS from"unplugin-vue-components/vite";import iS from"@intlify/unplugin-vue-i18n/vite";import jd from"dayjs";import{convert as oS}from"html-to-text";import Wx from"markdown-it";import _d from"markdown-it-anchor";import Yx from"markdown-it-attrs";import Kx from"markdown-it-emoji";import zx from"markdown-it-task-lists";import KE from"markdown-it/lib/common/html_blocks.js";var zE="[a-zA-Z_:@][a-zA-Z0-9:._-]*",JE="[^\"'=<>`\\x00-\\x20]+",QE="'[^']*'",XE='"[^"]*"',ZE="(?:"+JE+"|"+QE+"|"+XE+")",xs="(?:\\s+"+zE+"(?:\\s*=\\s*"+ZE+")?)",Up="<[A-Za-z][A-Za-z0-9\\-]*"+xs+"*\\s*\\/?>",Gp="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ex="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",tx="<[?][\\s\\S]*?[?]>",rx="<![A-Z]+\\s+[^>]*>",nx="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",ix=new RegExp("^(?:"+Up+"|"+Gp+"|"+ex+"|"+tx+"|"+rx+"|"+nx+")"),ox=new RegExp("^(?:"+Up+"|"+Gp+")"),sx=new RegExp("^<[A-Za-z][A-Za-z0-9\\-]*"+xs+"*\\s*\\/>"),ax=new RegExp("^<([A-Za-z][A-Za-z0-9\\-]*)"+xs+"*\\s*>.*<\\/\\1\\s*>"),ux=KE,cx=["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"],lx=["template","component","transition","transition-group","keep-alive","slot","teleport"],fx=({blockTags:e,inlineTags:t})=>{let r=[...e,...ux],n=[...t,...cx.filter(o=>!lx.includes(o))];return[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp("^</?(?!("+n.join("|")+")(?![\\w-]))[A-Za-z][A-Za-z0-9\\-]*(?=(\\s|/?>|$))"),/^$/,!0],[new RegExp(ox.source+"\\s*$"),/^$/,!1]]},px=e=>{let t=fx(e);return(r,n,i,o)=>{let s,a,u,l=r.bMarks[n]+r.tShift[n],c=r.eMarks[n];if(r.sCount[n]-r.blkIndent>=4||!r.md.options.html||r.src.charCodeAt(l)!==60)return!1;for(u=r.src.slice(l,c),s=0;s<t.length&&!t[s][0].test(u);s++);if(s===t.length)return!1;if(o)return t[s][2];if(s===6){let f=u.match(sx)??u.match(ax);if(f){r.line=n+1;let y=r.push("html_inline","",0);return y.content=f[0],y.map=[n,r.line],y=r.push("inline","",0),y.content=u.slice(f[0].length),y.map=[n,r.line],y.children=[],!0}}if(a=n+1,!t[s][1].test(u)){for(;a<i&&!(r.sCount[a]<r.blkIndent);a++)if(l=r.bMarks[a]+r.tShift[a],c=r.eMarks[a],u=r.src.slice(l,c),t[s][1].test(u)){u.length!==0&&a++;break}}r.line=a;let p=r.push("html_block","",0);return p.map=[n,a],p.content=r.getLines(n,a,r.blkIndent,!0),!0}},dx=e=>{let t=e|32;return t>=97&&t<=122},mx=(e,t)=>{let{pos:r}=e;if(!e.md.options.html)return!1;let n=e.posMax;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!dx(i))return!1;let o=e.src.slice(r).match(ix);if(!o)return!1;if(!t){let s=e.push("html_inline","",0);s.content=e.src.slice(r,r+o[0].length)}return e.pos+=o[0].length,!0},Wp=(e,{blockTags:t=[],inlineTags:r=[]}={})=>{let n=px({blockTags:t,inlineTags:r});e.block.ruler.at("html_block",n,{alt:["paragraph","reference","blockquote"]}),e.inline.ruler.at("html_inline",mx)};import hx from"gray-matter";var Yp=(e,{grayMatterOptions:t,renderExcerpt:r=!0}={})=>{let n=e.render.bind(e);e.render=(i,o={})=>{let{data:s,content:a,excerpt:u=""}=hx(i,t);return o.content=a,o.frontmatter={...o.frontmatter,...s},o.excerpt=r&&u?n(u,{...o}):u,n(a,o)}};var gx={"&":"&","<":"<",">":">","'":"'",'"':"""},yx=/[&<>'"]/g,_t=e=>e.replace(yx,t=>gx[t]);var Er=(e,{shouldAllowHtml:t,shouldEscapeText:r})=>{let n=e.children??[],i=["text","emoji","code_inline"];return t&&i.push("html_inline"),n.filter(s=>i.includes(s.type)&&!s.meta?.isPermalinkSymbol).reduce((s,a)=>r&&(a.type==="code_inline"||a.type==="text")?`${s}${_t(a.content)}`:`${s}${a.content}`,"").trim()},On=(e,{level:t,shouldAllowHtml:r,shouldEscapeText:n,slugify:i,format:o})=>{let s=[],a=[],u=l=>{for(;a.length!==0&&l.level<=a[0].level;)a.shift();a.length===0?(s.push(l),a.push(l)):(a[0].children.push(l),a.unshift(l))};for(let l=0;l<e.length;l+=1){let c=e[l];if(c?.type!=="heading_open"||c?.level!==0)continue;let p=Number.parseInt(c.tag.slice(1),10);if(!t.includes(p))continue;let f=e[l+1];if(!f)continue;let y=Er(f,{shouldAllowHtml:r,shouldEscapeText:n}),h=c.attrGet("id")??i(y);u({level:p,title:o?.(y)??y,slug:h,link:`#${h}`,children:[]})}return s},vx=/[\u0000-\u001f]/g,_x=/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g,Ex=/[\u0300-\u036F]/g,Pn=e=>e.normalize("NFKD").replace(Ex,"").replace(vx,"").replace(_x,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/^(\d)/,"_$1").toLowerCase();var Kp=(e,{level:t=[2,3],slugify:r=Pn,format:n}={})=>{let i=e.renderer.render.bind(e.renderer);e.renderer.render=(o,s,a)=>(a.headers=On(o,{level:t,shouldAllowHtml:!1,shouldEscapeText:!1,slugify:r,format:n}),i(o,s,a))};var zp="script",Jp="style",xr="template",xx=/^<script\s+.*?\bsetup\b.*?>$/is,bx=({customBlocks:e})=>{let t=Array.from(new Set([zp,Jp,...e])).join("|");return new RegExp(`^\\s*(?<content>(?<tagOpen><(?<type>${t})\\s?.*?>)(?<contentStripped>.*)(?<tagClose><\\/\\k<type>\\s*>))\\s*$`,"is")},Qp=(e,{customBlocks:t=[]}={})=>{let r=bx({customBlocks:t}),n=e.render.bind(e);e.render=(o,s={})=>{s.sfcBlocks={template:null,script:null,scriptSetup:null,scripts:[],styles:[],customBlocks:[]};let a=n(o,s);return s.sfcBlocks.template={type:xr,content:`<${xr}>${a}</${xr}>`,contentStripped:a,tagOpen:`<${xr}>`,tagClose:`</${xr}>`},a};let i=e.renderer.rules.html_block;e.renderer.rules.html_block=(o,s,a,u,l)=>{if(!u.sfcBlocks)return i(o,s,a,u,l);let f=o[s].content.match(r);if(!f)return i(o,s,a,u,l);let y=f.groups;return y.type===zp?(u.sfcBlocks.scripts.push(y),xx.test(y.tagOpen)?u.sfcBlocks.scriptSetup=y:u.sfcBlocks.script=y):y.type===Jp?u.sfcBlocks.styles.push(y):u.sfcBlocks.customBlocks.push(y),""}};var Xp=e=>{let t=e.renderer.render.bind(e.renderer);e.renderer.render=(r,n,i)=>{let o=r.findIndex(s=>s.tag==="h1");return i.title=o>-1?Er(r[o+1],{shouldAllowHtml:!1,shouldEscapeText:!1}):"",t(r,n,i)}};var Sx=({listTag:e,listClass:t,itemClass:r,linkTag:n,linkClass:i})=>{let o=_t(e),s=t?` class="${_t(t)}"`:"",a="li",u=r?` class="${_t(r)}"`:"",l=_t(n),c=i?` class="${_t(i)}"`:"",p=y=>n==="router-link"?` to="${y}"`:` href="${y}"`,f=y=>`<${o}${s}>${y.map(h=>`<${a}${u}${u}><${l}${c}${p(h.link)}>${h.title}</${l}>${h.children.length>0?f(h.children):""}</${a}>`).join("")}</${o}>`;return f},Cx=({pattern:e,containerTag:t,containerClass:r})=>(n,i,o,s)=>{if(n.sCount[i]-n.blkIndent>=4)return!1;let a=n.bMarks[i]+n.tShift[i],u=n.eMarks[i],l=n.src.slice(a,u).split(" ")[0];if(!e.test(l))return!1;if(s)return!0;n.line=i+1;let c=n.push("toc_open",t,1);c.markup="",c.map=[i,n.line],r&&c.attrSet("class",r);let p=n.push("toc_body","",0);p.markup=l,p.map=[i,n.line],p.hidden=!0;let f=n.push("toc_close",t,-1);return f.markup="",p.map=[i,n.line],!0},Zp=(e,{pattern:t=/^\[\[toc\]\]$/i,slugify:r=Pn,format:n,level:i=[2,3],containerTag:o="nav",containerClass:s="table-of-contents",listTag:a="ul",listClass:u="",itemClass:l="",linkTag:c="a",linkClass:p=""}={})=>{e.block.ruler.before("heading","toc",Cx({pattern:t,containerTag:o,containerClass:s}),{alt:["paragraph","reference","blockquote"]});let f=Sx({listTag:a,listClass:u,itemClass:l,linkTag:c,linkClass:p});e.renderer.rules.toc_body=y=>f(On(y,{level:i,shouldAllowHtml:!0,shouldEscapeText:!0,slugify:r,format:n}))};import ed from"katex";function td(e,t){let r=e.posMax,n=!0,i=!0,o=t>0?e.src.charCodeAt(t-1):-1,s=t+1<=r?e.src.charCodeAt(t+1):-1;return(o===32||o===9||s>=48&&s<=57)&&(i=!1),(s===32||s===9)&&(n=!1),{can_open:n,can_close:i}}function wx(e,t){let r,n,i,o;if(e.src[e.pos]!=="$")return!1;if(i=td(e,e.pos),!i.can_open)return t||(e.pending+="$"),e.pos+=1,!0;let s=e.pos+1;for(r=s;(r=e.src.indexOf("$",r))!==-1;){for(o=r-1;e.src[o]==="\\";)o-=1;if((r-o)%2===1)break;r+=1}return r===-1?(t||(e.pending+="$"),e.pos=s,!0):r-s===0?(t||(e.pending+="$$"),e.pos=s+1,!0):(i=td(e,r),i.can_close?(t||(n=e.push("math_inline","math",0),n.markup="$",n.content=e.src.slice(s,r)),e.pos=r+1,!0):(t||(e.pending+="$"),e.pos=s,!0))}function Ax(e,t,r,n){let i,o,s,a,u=!1,l=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(l+2>c||e.src.slice(l,l+2)!=="$$")return!1;if(l+=2,i=e.src.slice(l,c),n)return!0;for(i.trim().slice(-2)==="$$"&&(i=i.trim().slice(0,-2),u=!0),s=t;!u&&(s++,!(s>=r||(l=e.bMarks[s]+e.tShift[s],c=e.eMarks[s],l<c&&e.tShift[s]<e.blkIndent)));)e.src.slice(l,c).trim().slice(-2)==="$$"&&(a=e.src.slice(0,c).lastIndexOf("$$"),o=e.src.slice(l,a),u=!0);e.line=s+1;let p=e.push("math_block","math",0);return p.block=!0,p.content=(i&&i.trim()?`${i}
|
|
19
19
|
`:"")+e.getLines(t+1,s,e.tShift[t],!0)+(o&&o.trim()?o:""),p.map=[t,e.line],p.markup="$$",!0}function bs(e,t){t=t||{};let r=function(s){t.displayMode=!1;try{return ed.renderToString(s,t)}catch(a){return t.throwOnError&&console.warn(a),s}},n=function(s,a){return r(s[a].content)},i=function(s){t.displayMode=!0;try{return`<p>${ed.renderToString(s,t)}</p>`}catch(a){return t.throwOnError&&console.warn(a),s}},o=function(s,a){return`${i(s[a].content)}
|
|
20
20
|
`};e.inline.ruler.after("escape","math_inline",wx),e.block.ruler.after("blockquote","math_block",Ax,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=n,e.renderer.rules.math_block=o}import Ss from"markdown-it-container";function Rx(e,{icon:t,color:r,text:n,langs:i}={}){return[Ss,e,{render(o,s){let a=o[s],u=a.info.trim().slice(e.length).trim();if(a.nesting===1){if(e==="details")return`<details class="${e} custom-block">${`<summary>${u}</summary>`}
|
|
@@ -14,7 +14,7 @@ GFS4: `),console.error(e)});K[oe]||(na=global[oe]||[],oa(K,na),K.close=function(
|
|
|
14
14
|
`)+r,i=n+1,n=e.indexOf(`
|
|
15
15
|
`,i)}while(n!==-1);return o+=e.substr(i),o};Sm.exports={stringReplaceAll:GS,stringEncaseCRLFWithFirstIndex:WS}});var Fm=v((_F,km)=>{"use strict";var YS=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,wm=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,KS=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,zS=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,JS=new Map([["n",`
|
|
16
16
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Rm(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):JS.get(e)||e}function QS(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),i;for(let o of n){let s=Number(o);if(!Number.isNaN(s))r.push(s);else if(i=o.match(KS))r.push(i[2].replace(zS,(a,u,l)=>u?Rm(u):l));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`)}return r}function XS(e){wm.lastIndex=0;let t=[],r;for(;(r=wm.exec(e))!==null;){let n=r[1];if(r[2]){let i=QS(n,r[2]);t.push([n].concat(i))}else t.push([n])}return t}function Am(e,t){let r={};for(let i of t)for(let o of i.styles)r[o[0]]=i.inverse?null:o.slice(1);let n=e;for(let[i,o]of Object.entries(r))if(!!Array.isArray(o)){if(!(i in n))throw new Error(`Unknown Chalk style: ${i}`);n=o.length>0?n[i](...o):n[i]}return n}km.exports=(e,t)=>{let r=[],n=[],i=[];if(t.replace(YS,(o,s,a,u,l,c)=>{if(s)i.push(Rm(s));else if(u){let p=i.join("");i=[],n.push(r.length===0?p:Am(e,r)(p)),r.push({inverse:a,styles:XS(u)})}else if(l){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(Am(e,r)(i.join(""))),i=[],r.pop()}else i.push(c)}),n.push(i.join("")),r.length>0){let o=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(o)}return n.join("")}});var Im=v((EF,Mm)=>{"use strict";var kr=ym(),{stdout:Us,stderr:Gs}=bm(),{stringReplaceAll:ZS,stringEncaseCRLFWithFirstIndex:eC}=Cm(),{isArray:Wn}=Array,Pm=["ansi","ansi","ansi256","ansi16m"],Xt=Object.create(null),tC=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Us?Us.level:0;e.level=t.level===void 0?r:t.level},Ws=class{constructor(t){return Tm(t)}},Tm=e=>{let t={};return tC(t,e),t.template=(...r)=>Dm(t.template,...r),Object.setPrototypeOf(t,Yn.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=Ws,t.template};function Yn(e){return Tm(e)}for(let[e,t]of Object.entries(kr))Xt[e]={get(){let r=Kn(this,Ys(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};Xt.visible={get(){let e=Kn(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var $m=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of $m)Xt[e]={get(){let{level:t}=this;return function(...r){let n=Ys(kr.color[Pm[t]][e](...r),kr.color.close,this._styler);return Kn(this,n,this._isEmpty)}}};for(let e of $m){let t="bg"+e[0].toUpperCase()+e.slice(1);Xt[t]={get(){let{level:r}=this;return function(...n){let i=Ys(kr.bgColor[Pm[r]][e](...n),kr.bgColor.close,this._styler);return Kn(this,i,this._isEmpty)}}}}var rC=Object.defineProperties(()=>{},{...Xt,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),Ys=(e,t,r)=>{let n,i;return r===void 0?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},Kn=(e,t,r)=>{let n=(...i)=>Wn(i[0])&&Wn(i[0].raw)?Om(n,Dm(n,...i)):Om(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,rC),n._generator=e,n._styler=t,n._isEmpty=r,n},Om=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=ZS(t,r.close,r.open),r=r.parent;let o=t.indexOf(`
|
|
17
|
-
`);return o!==-1&&(t=eC(t,i,n,o)),n+t+i},Vs,Dm=(e,...t)=>{let[r]=t;if(!Wn(r)||!Wn(r.raw))return t.join(" ");let n=t.slice(1),i=[r.raw[0]];for(let o=1;o<r.length;o++)i.push(String(n[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return Vs===void 0&&(Vs=Fm()),Vs(e,i.join(""))};Object.defineProperties(Yn.prototype,Xt);var zn=Yn();zn.supportsColor=Us;zn.stderr=Yn({level:Gs?Gs.level:0});zn.stderr.supportsColor=Gs;Mm.exports=zn});var er=Q(Ae(),1);var _path = require('path'); var _path2 = _interopRequireDefault(_path);var _child_process = require('child_process');var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);var _vite = require('vite');var _open2 = require('open'); var _open3 = _interopRequireDefault(_open2);var _consola = require('consola'); var _consola2 = _interopRequireDefault(_consola);var _kolorist = require('kolorist');var _helpers = require('yargs/helpers');var Hr="0.14.
|
|
17
|
+
`);return o!==-1&&(t=eC(t,i,n,o)),n+t+i},Vs,Dm=(e,...t)=>{let[r]=t;if(!Wn(r)||!Wn(r.raw))return t.join(" ");let n=t.slice(1),i=[r.raw[0]];for(let o=1;o<r.length;o++)i.push(String(n[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return Vs===void 0&&(Vs=Fm()),Vs(e,i.join(""))};Object.defineProperties(Yn.prototype,Xt);var zn=Yn();zn.supportsColor=Us;zn.stderr=Yn({level:Gs?Gs.level:0});zn.stderr.supportsColor=Gs;Mm.exports=zn});var er=Q(Ae(),1);var _path = require('path'); var _path2 = _interopRequireDefault(_path);var _child_process = require('child_process');var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);var _vite = require('vite');var _open2 = require('open'); var _open3 = _interopRequireDefault(_open2);var _consola = require('consola'); var _consola2 = _interopRequireDefault(_consola);var _kolorist = require('kolorist');var _helpers = require('yargs/helpers');var Hr="0.14.2";var _net = require('net'); var _net2 = _interopRequireDefault(_net);async function gi(e){return await n1(e)?e:await gi(e+1)}function n1(e){return new Promise(t=>{let r=_net2.default.createServer(n=>{n.write(`Echo server\r
|
|
18
18
|
`),n.pipe(n)});r.listen(e,"0.0.0.0"),r.on("error",()=>{t(!1)}),r.on("listening",()=>{r.close(),t(!0)})})}var jp=Q(Ae(),1),Hp=Q(Ei(),1),Vp=Q(bn(),1);var _utils = require('@antfu/utils');function ns(e){return e!==null&&typeof e=="object"}function is(e,t,r=".",n){if(!ns(t))return is(e,{},r,n);let i=Object.assign({},t);for(let o in e){if(o==="__proto__"||o==="constructor")continue;let s=e[o];s!=null&&(n&&n(i,o,s,r)||(Array.isArray(s)&&Array.isArray(i[o])?i[o]=s.concat(i[o]):ns(s)&&ns(i[o])?i[o]=is(s,i[o],(r?`${r}.`:"")+o.toString(),n):i[o]=s))}return i}function mr(e){return(...t)=>t.reduce((r,n)=>is(r,n,"",e),{})}var $e=mr(),kw=mr((e,t,r,n)=>{if(typeof e[t]<"u"&&typeof r=="function")return e[t]=r(e[t]),!0}),Fw=mr((e,t,r,n)=>{if(Array.isArray(e[t])&&typeof r=="function")return e[t]=r(e[t]),!0});var os=()=>process.env.NODE_ENV==="production",ss=(e="development")=>{process.env.NODE_ENV=e,we.level=os()?2:3},hr=()=>ss("production");var we=_consola2.default.create({level:os()?2:3});var Tp=Q(bp(),1);var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);var _globaldirs = require('global-dirs'); var _globaldirs2 = _interopRequireDefault(_globaldirs);var _crossspawn = require('cross-spawn');function _r(e,t="updated"){return new Promise((r,n)=>{let i=["log"];t==="updated"&&i.push("-1"),i.push('--pretty="%ci"',e),t==="created"&&i.push("|","tail","-1");let o=_crossspawn.spawn.call(void 0, "git",i),s="";o.stdout.on("data",a=>s+=String(a)),o.on("close",()=>{r(+new Date(s))}),o.on("error",()=>{r(0)})})}var An="<!-- more -->",jt=/^https?:/i,Sp=/^pathname:\/\//;function Cp(e){return jt.test(e)}function it(e){return e.replace(/\\/g,"/")}function hs(e,t){return t.startsWith(e)?t:e+t}function te(e){return`/@fs${hs("/",it(e))}`}function wp(e){return e.startsWith("/")||/^\.\.?[\/\\]/.test(e)}var _unconfig = require('unconfig');async function vt(e,t={}){let{config:r,sources:n}=await await _unconfig.loadConfig.call(void 0, {sources:{files:e,rewrite:t.rewrite},cwd:t.cwd||process.cwd()}),i=_vite.normalizePath.call(void 0, n[0]||"");return{config:r,configFile:i}}var Ht=mr((e,t,r)=>{if(_utils.isFunction.call(void 0, e[t])&&_utils.isFunction.call(void 0, r)&&(e[t]=function(...n){e[t].call(this,...n),r.call(this,...n)}),t==="vite")return e[t]=_vite.mergeConfig.call(void 0, e[t],r),!0});async function gs(e,t){return vt("valaxy.config",{rewrite(r){return typeof r=="function"?r(t||{}):r},cwd:e})}async function Rp(e){let{config:t,configFile:r}=await gs(e.userRoot||process.cwd());t&&we.info(`Resolve ${_kolorist.cyan.call(void 0, "valaxyConfig")} from ${_kolorist.dim.call(void 0, r)}`);let n=e.theme||t.theme||"yun";return{config:t,configFile:r,theme:n}}async function kp(e,t){let r={};for(let n of e){let{config:i,configFile:o}=await vt("index",{rewrite(s,a){return typeof s=="function"?s(n,t):s},cwd:n.root});!i||(n.configFile=o,r=Ht(i,r))}return r}var $p=e=>`JSON.parse(${JSON.stringify(JSON.stringify(e))})`;function Ge(e,t=!1,r={preserveSymlinks:!1}){try{return(0,Tp.sync)(e,r)}catch(n){_consola2.default.log(n)}if(_isinstalledglobally2.default){try{return I.resolve(_path.join.call(void 0, _globaldirs2.default.yarn.packages,e))}catch (e21){}try{return I.resolve(_path.join.call(void 0, _globaldirs2.default.npm.packages,e))}catch (e22){}}if(t)throw new Error(`Failed to resolve package ${e}`);_consola2.default.error(`Failed to resolve package ${e}`)}function RE(e){return e}var bA=RE;function kE(e){return e}var SA=kE;function wA(e){return e}function FE(e){return e}var AA=FE,ys= exports.t ={mode:"auto",url:"/",lang:"en",title:"Valaxy Blog",description:"A blog generated by Valaxy.",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://www.yunyoujun.cn/images/avatar.jpg",email:"i@valaxy.site",link:"https://valaxy.site",name:"VALAXY Developer",status:{emoji:"\u{1F30C}",message:"The moonlight is beautiful."}},favicon:"/favicon.svg",feed:{name:"",favicon:"/favicon.svg"},social:[],date:{format:""},lastUpdated:!0,license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u8D5E\u52A9",methods:[]},search:{enable:!1,type:"fuse"},comment:{enable:!1},cdn:{prefix:"https://unpkg.com/"},mediumZoom:{enable:!1,selector:"",options:{}}},Dp= exports.u ={ignoreDeadLinks:!0,siteConfig:ys,theme:"yun",themeConfig:{pkg:{name:"",version:""}},runtimeConfig:{addons:{}},features:{katex:!0},vite:{build:{rollupOptions:{external:[]}}}};function RA(e){return e}var vs=Q(Ae(),1);var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);function Rn(e,t){if(!e)return"";if(wp(e))if(t){let r=_fs2.default.lstatSync(t).isFile();return _path.resolve.call(void 0, r?_path.dirname.call(void 0, t):t,e)}else throw new Error(`entry is required when ${e} is path`);else return _path.dirname.call(void 0, Ge(`${e}/package.json`)||"")}async function Lp(e,t=process.cwd()){let r={},n=o=>{o&&(r[o.name]=$e(r[o.name]||{},o))};if(Array.isArray(e))for(let o of e){if(typeof o=="string"){n(await Ip(o,{cwd:t}));continue}typeof o=="object"&&n($e(await Ip(o.name,{cwd:t}),o||{}))}let i=Object.values(r).filter(o=>o.enable);return we.info(`Resolve ${_kolorist.cyan.call(void 0, "addons:")} ${_kolorist.yellow.call(void 0, i.map(o=>o.name).join(", "))}`),i}async function Ip(e,t={}){let r=ME(e,t.cwd||process.cwd()),n=_path.resolve.call(void 0, r,"./package.json");if(!vs.default.existsSync(n)){we.error(`No addon named ${e} found`);return}let i=await vs.default.readJSON(n);return{enable:!0,name:i.name,global:!!i.global,root:r,options:{},props:{}}}function ME(e,t){let r=e.startsWith("valaxy-addon")||e.startsWith(".")?e:`valaxy-addon-${e}`;return Rn(r,t)}function Np(e,t){let r=e.startsWith("valaxy-theme")||e.startsWith(".")?e:`valaxy-theme-${e}`;return Rn(r,t)}async function NE(e){return vt("site.config",{cwd:e})}async function kn(e){let{config:t,configFile:r}=await NE(e);return t&&we.info(`Resolve ${_kolorist.cyan.call(void 0, "siteConfig")} from ${_kolorist.dim.call(void 0, r)}`),{siteConfig:t,siteConfigFile:r}}async function jE(e){return vt("theme.config",{cwd:e})}async function qp(e){let{config:t,configFile:r}=await jE(e);return t&&we.info(`Resolve ${_kolorist.cyan.call(void 0, "themeConfig")} from ${_kolorist.dim.call(void 0, r)}`),{themeConfig:t,themeConfigFile:r}}var WE=(0,Hp.default)("valaxy:options");async function YE(e){let{config:t,themeRoot:r,theme:n}=e,i=t.siteConfig;i.url=_utils.ensureSuffix.call(void 0, "/",i.url||""),i.cdn.prefix=_utils.ensureSuffix.call(void 0, "/",i.cdn.prefix||"");let o=_path.resolve.call(void 0, r,"package.json");try{t.themeConfig.pkg=await jp.default.readJson(o,"utf-8")}catch (e23){console.error(`valaxy-theme-${n} doesn't have package.json`)}}async function _s(e,t){let{clientRoot:r,themeRoot:n,userRoot:i}=e,o=await Lp(t.addons||[],e.userRoot),s=await kp(o,e);t=Ht(t,s);let a=$e(t,Dp);e.config={...a,runtimeConfig:{addons:{}}},e.addons=o,o.forEach(p=>{e.config.runtimeConfig.addons[p.name]=p});let u=o.map(({root:p})=>p),l=o.map(({name:p})=>p);e.addonRoots=u,e.roots=_utils.uniq.call(void 0, [r,n,...u,i]);let c=_optionalChain([e, 'access', _3 => _3.config, 'access', _4 => _4.vite, 'optionalAccess', _5 => _5.build, 'optionalAccess', _6 => _6.rollupOptions, 'optionalAccess', _7 => _7.external])||[];return e.config.vite.build.rollupOptions.external=c.filter(p=>!l.includes(p)),await YE(e),e}async function De(e={userRoot:process.cwd()},t="dev"){let r=_path.dirname.call(void 0, Ge("valaxy/package.json",!0)),n=_path.resolve.call(void 0, r,"client"),i=_path.resolve.call(void 0, e.userRoot||process.cwd()),{config:o,configFile:s,theme:a}=await Rp(e),{siteConfig:u,siteConfigFile:l}=await kn(e.userRoot),{themeConfig:c,themeConfigFile:p}=await qp(e.userRoot);o=$e({siteConfig:u},{themeConfig:c},o);let f=Np(a,e.userRoot),y=(await(0,Vp.default)(["**.md"],{cwd:_path.resolve.call(void 0, i,"pages"),ignore:["**/node_modules"]})).sort(),h={mode:t,pkgRoot:r,clientRoot:n,userRoot:i,themeRoot:f,addonRoots:[],roots:[],theme:a,config:{...o,runtimeConfig:{addons:{}}},configFile:s||"",siteConfigFile:l||"",themeConfigFile:p||"",pages:y,addons:[]};WE(h);let _=await Es(h),E=Ht(o,_);return h=await _s(h,E),h}async function Es(e){we.info(`Resolve ${_kolorist.cyan.call(void 0, "valaxy.config.ts")} from ${_kolorist.yellow.call(void 0, `theme(${e.theme})`)}`);let{config:t}=await gs(e.themeRoot,e);return t}var _readline = require('readline'); var Gd = _interopRequireWildcard(_readline);var _os = require('os'); var _os2 = _interopRequireDefault(_os);var _markdownit = require('markdown-it'); var _markdownit2 = _interopRequireDefault(_markdownit);var _graymatter = require('gray-matter'); var _graymatter2 = _interopRequireDefault(_graymatter);var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);var _vitepluginpages = require('vite-plugin-pages'); var _vitepluginpages2 = _interopRequireDefault(_vitepluginpages);var _vitepluginvuelayouts = require('vite-plugin-vue-layouts'); var _vitepluginvuelayouts2 = _interopRequireDefault(_vitepluginvuelayouts);var _vite3 = require('unplugin-vue-components/vite'); var _vite4 = _interopRequireDefault(_vite3);var _vite5 = require('@intlify/unplugin-vue-i18n/vite'); var _vite6 = _interopRequireDefault(_vite5);var _dayjs = require('dayjs'); var _dayjs2 = _interopRequireDefault(_dayjs);var _htmltotext = require('html-to-text');var _markdownitanchor = require('markdown-it-anchor'); var _markdownitanchor2 = _interopRequireDefault(_markdownitanchor);var _markdownitattrs = require('markdown-it-attrs'); var _markdownitattrs2 = _interopRequireDefault(_markdownitattrs);var _markdownitemoji = require('markdown-it-emoji'); var _markdownitemoji2 = _interopRequireDefault(_markdownitemoji);var _markdownittasklists = require('markdown-it-task-lists'); var _markdownittasklists2 = _interopRequireDefault(_markdownittasklists);var _html_blocksjs = require('markdown-it/lib/common/html_blocks.js'); var _html_blocksjs2 = _interopRequireDefault(_html_blocksjs);var zE="[a-zA-Z_:@][a-zA-Z0-9:._-]*",JE="[^\"'=<>`\\x00-\\x20]+",QE="'[^']*'",XE='"[^"]*"',ZE="(?:"+JE+"|"+QE+"|"+XE+")",xs="(?:\\s+"+zE+"(?:\\s*=\\s*"+ZE+")?)",Up="<[A-Za-z][A-Za-z0-9\\-]*"+xs+"*\\s*\\/?>",Gp="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ex="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",tx="<[?][\\s\\S]*?[?]>",rx="<![A-Z]+\\s+[^>]*>",nx="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",ix=new RegExp("^(?:"+Up+"|"+Gp+"|"+ex+"|"+tx+"|"+rx+"|"+nx+")"),ox=new RegExp("^(?:"+Up+"|"+Gp+")"),sx=new RegExp("^<[A-Za-z][A-Za-z0-9\\-]*"+xs+"*\\s*\\/>"),ax=new RegExp("^<([A-Za-z][A-Za-z0-9\\-]*)"+xs+"*\\s*>.*<\\/\\1\\s*>"),ux=_html_blocksjs2.default,cx=["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"],lx=["template","component","transition","transition-group","keep-alive","slot","teleport"],fx=({blockTags:e,inlineTags:t})=>{let r=[...e,...ux],n=[...t,...cx.filter(o=>!lx.includes(o))];return[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp("^</?(?!("+n.join("|")+")(?![\\w-]))[A-Za-z][A-Za-z0-9\\-]*(?=(\\s|/?>|$))"),/^$/,!0],[new RegExp(ox.source+"\\s*$"),/^$/,!1]]},px=e=>{let t=fx(e);return(r,n,i,o)=>{let s,a,u,l=r.bMarks[n]+r.tShift[n],c=r.eMarks[n];if(r.sCount[n]-r.blkIndent>=4||!r.md.options.html||r.src.charCodeAt(l)!==60)return!1;for(u=r.src.slice(l,c),s=0;s<t.length&&!t[s][0].test(u);s++);if(s===t.length)return!1;if(o)return t[s][2];if(s===6){let f=_nullishCoalesce(u.match(sx), () => (u.match(ax)));if(f){r.line=n+1;let y=r.push("html_inline","",0);return y.content=f[0],y.map=[n,r.line],y=r.push("inline","",0),y.content=u.slice(f[0].length),y.map=[n,r.line],y.children=[],!0}}if(a=n+1,!t[s][1].test(u)){for(;a<i&&!(r.sCount[a]<r.blkIndent);a++)if(l=r.bMarks[a]+r.tShift[a],c=r.eMarks[a],u=r.src.slice(l,c),t[s][1].test(u)){u.length!==0&&a++;break}}r.line=a;let p=r.push("html_block","",0);return p.map=[n,a],p.content=r.getLines(n,a,r.blkIndent,!0),!0}},dx=e=>{let t=e|32;return t>=97&&t<=122},mx=(e,t)=>{let{pos:r}=e;if(!e.md.options.html)return!1;let n=e.posMax;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!dx(i))return!1;let o=e.src.slice(r).match(ix);if(!o)return!1;if(!t){let s=e.push("html_inline","",0);s.content=e.src.slice(r,r+o[0].length)}return e.pos+=o[0].length,!0},Wp=(e,{blockTags:t=[],inlineTags:r=[]}={})=>{let n=px({blockTags:t,inlineTags:r});e.block.ruler.at("html_block",n,{alt:["paragraph","reference","blockquote"]}),e.inline.ruler.at("html_inline",mx)};var Yp=(e,{grayMatterOptions:t,renderExcerpt:r=!0}={})=>{let n=e.render.bind(e);e.render=(i,o={})=>{let{data:s,content:a,excerpt:u=""}=_graymatter2.default.call(void 0, i,t);return o.content=a,o.frontmatter={...o.frontmatter,...s},o.excerpt=r&&u?n(u,{...o}):u,n(a,o)}};var gx={"&":"&","<":"<",">":">","'":"'",'"':"""},yx=/[&<>'"]/g,_t=e=>e.replace(yx,t=>gx[t]);var Er=(e,{shouldAllowHtml:t,shouldEscapeText:r})=>{let n=_nullishCoalesce(e.children, () => ([])),i=["text","emoji","code_inline"];return t&&i.push("html_inline"),n.filter(s=>i.includes(s.type)&&!_optionalChain([s, 'access', _8 => _8.meta, 'optionalAccess', _9 => _9.isPermalinkSymbol])).reduce((s,a)=>r&&(a.type==="code_inline"||a.type==="text")?`${s}${_t(a.content)}`:`${s}${a.content}`,"").trim()},On=(e,{level:t,shouldAllowHtml:r,shouldEscapeText:n,slugify:i,format:o})=>{let s=[],a=[],u=l=>{for(;a.length!==0&&l.level<=a[0].level;)a.shift();a.length===0?(s.push(l),a.push(l)):(a[0].children.push(l),a.unshift(l))};for(let l=0;l<e.length;l+=1){let c=e[l];if(_optionalChain([c, 'optionalAccess', _10 => _10.type])!=="heading_open"||_optionalChain([c, 'optionalAccess', _11 => _11.level])!==0)continue;let p=Number.parseInt(c.tag.slice(1),10);if(!t.includes(p))continue;let f=e[l+1];if(!f)continue;let y=Er(f,{shouldAllowHtml:r,shouldEscapeText:n}),h=_nullishCoalesce(c.attrGet("id"), () => (i(y)));u({level:p,title:_nullishCoalesce(_optionalChain([o, 'optionalCall', _12 => _12(y)]), () => (y)),slug:h,link:`#${h}`,children:[]})}return s},vx=/[\u0000-\u001f]/g,_x=/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g,Ex=/[\u0300-\u036F]/g,Pn=e=>e.normalize("NFKD").replace(Ex,"").replace(vx,"").replace(_x,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/^(\d)/,"_$1").toLowerCase();var Kp=(e,{level:t=[2,3],slugify:r=Pn,format:n}={})=>{let i=e.renderer.render.bind(e.renderer);e.renderer.render=(o,s,a)=>(a.headers=On(o,{level:t,shouldAllowHtml:!1,shouldEscapeText:!1,slugify:r,format:n}),i(o,s,a))};var zp="script",Jp="style",xr="template",xx=/^<script\s+.*?\bsetup\b.*?>$/is,bx=({customBlocks:e})=>{let t=Array.from(new Set([zp,Jp,...e])).join("|");return new RegExp(`^\\s*(?<content>(?<tagOpen><(?<type>${t})\\s?.*?>)(?<contentStripped>.*)(?<tagClose><\\/\\k<type>\\s*>))\\s*$`,"is")},Qp=(e,{customBlocks:t=[]}={})=>{let r=bx({customBlocks:t}),n=e.render.bind(e);e.render=(o,s={})=>{s.sfcBlocks={template:null,script:null,scriptSetup:null,scripts:[],styles:[],customBlocks:[]};let a=n(o,s);return s.sfcBlocks.template={type:xr,content:`<${xr}>${a}</${xr}>`,contentStripped:a,tagOpen:`<${xr}>`,tagClose:`</${xr}>`},a};let i=e.renderer.rules.html_block;e.renderer.rules.html_block=(o,s,a,u,l)=>{if(!u.sfcBlocks)return i(o,s,a,u,l);let f=o[s].content.match(r);if(!f)return i(o,s,a,u,l);let y=f.groups;return y.type===zp?(u.sfcBlocks.scripts.push(y),xx.test(y.tagOpen)?u.sfcBlocks.scriptSetup=y:u.sfcBlocks.script=y):y.type===Jp?u.sfcBlocks.styles.push(y):u.sfcBlocks.customBlocks.push(y),""}};var Xp=e=>{let t=e.renderer.render.bind(e.renderer);e.renderer.render=(r,n,i)=>{let o=r.findIndex(s=>s.tag==="h1");return i.title=o>-1?Er(r[o+1],{shouldAllowHtml:!1,shouldEscapeText:!1}):"",t(r,n,i)}};var Sx=({listTag:e,listClass:t,itemClass:r,linkTag:n,linkClass:i})=>{let o=_t(e),s=t?` class="${_t(t)}"`:"",a="li",u=r?` class="${_t(r)}"`:"",l=_t(n),c=i?` class="${_t(i)}"`:"",p=y=>n==="router-link"?` to="${y}"`:` href="${y}"`,f=y=>`<${o}${s}>${y.map(h=>`<${a}${u}${u}><${l}${c}${p(h.link)}>${h.title}</${l}>${h.children.length>0?f(h.children):""}</${a}>`).join("")}</${o}>`;return f},Cx=({pattern:e,containerTag:t,containerClass:r})=>(n,i,o,s)=>{if(n.sCount[i]-n.blkIndent>=4)return!1;let a=n.bMarks[i]+n.tShift[i],u=n.eMarks[i],l=n.src.slice(a,u).split(" ")[0];if(!e.test(l))return!1;if(s)return!0;n.line=i+1;let c=n.push("toc_open",t,1);c.markup="",c.map=[i,n.line],r&&c.attrSet("class",r);let p=n.push("toc_body","",0);p.markup=l,p.map=[i,n.line],p.hidden=!0;let f=n.push("toc_close",t,-1);return f.markup="",p.map=[i,n.line],!0},Zp=(e,{pattern:t=/^\[\[toc\]\]$/i,slugify:r=Pn,format:n,level:i=[2,3],containerTag:o="nav",containerClass:s="table-of-contents",listTag:a="ul",listClass:u="",itemClass:l="",linkTag:c="a",linkClass:p=""}={})=>{e.block.ruler.before("heading","toc",Cx({pattern:t,containerTag:o,containerClass:s}),{alt:["paragraph","reference","blockquote"]});let f=Sx({listTag:a,listClass:u,itemClass:l,linkTag:c,linkClass:p});e.renderer.rules.toc_body=y=>f(On(y,{level:i,shouldAllowHtml:!0,shouldEscapeText:!0,slugify:r,format:n}))};var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);function td(e,t){let r=e.posMax,n=!0,i=!0,o=t>0?e.src.charCodeAt(t-1):-1,s=t+1<=r?e.src.charCodeAt(t+1):-1;return(o===32||o===9||s>=48&&s<=57)&&(i=!1),(s===32||s===9)&&(n=!1),{can_open:n,can_close:i}}function wx(e,t){let r,n,i,o;if(e.src[e.pos]!=="$")return!1;if(i=td(e,e.pos),!i.can_open)return t||(e.pending+="$"),e.pos+=1,!0;let s=e.pos+1;for(r=s;(r=e.src.indexOf("$",r))!==-1;){for(o=r-1;e.src[o]==="\\";)o-=1;if((r-o)%2===1)break;r+=1}return r===-1?(t||(e.pending+="$"),e.pos=s,!0):r-s===0?(t||(e.pending+="$$"),e.pos=s+1,!0):(i=td(e,r),i.can_close?(t||(n=e.push("math_inline","math",0),n.markup="$",n.content=e.src.slice(s,r)),e.pos=r+1,!0):(t||(e.pending+="$"),e.pos=s,!0))}function Ax(e,t,r,n){let i,o,s,a,u=!1,l=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(l+2>c||e.src.slice(l,l+2)!=="$$")return!1;if(l+=2,i=e.src.slice(l,c),n)return!0;for(i.trim().slice(-2)==="$$"&&(i=i.trim().slice(0,-2),u=!0),s=t;!u&&(s++,!(s>=r||(l=e.bMarks[s]+e.tShift[s],c=e.eMarks[s],l<c&&e.tShift[s]<e.blkIndent)));)e.src.slice(l,c).trim().slice(-2)==="$$"&&(a=e.src.slice(0,c).lastIndexOf("$$"),o=e.src.slice(l,a),u=!0);e.line=s+1;let p=e.push("math_block","math",0);return p.block=!0,p.content=(i&&i.trim()?`${i}
|
|
19
19
|
`:"")+e.getLines(t+1,s,e.tShift[t],!0)+(o&&o.trim()?o:""),p.map=[t,e.line],p.markup="$$",!0}function bs(e,t){t=t||{};let r=function(s){t.displayMode=!1;try{return _katex2.default.renderToString(s,t)}catch(a){return t.throwOnError&&console.warn(a),s}},n=function(s,a){return r(s[a].content)},i=function(s){t.displayMode=!0;try{return`<p>${_katex2.default.renderToString(s,t)}</p>`}catch(a){return t.throwOnError&&console.warn(a),s}},o=function(s,a){return`${i(s[a].content)}
|
|
20
20
|
`};e.inline.ruler.after("escape","math_inline",wx),e.block.ruler.after("blockquote","math_block",Ax,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=n,e.renderer.rules.math_block=o}var _markdownitcontainer = require('markdown-it-container'); var _markdownitcontainer2 = _interopRequireDefault(_markdownitcontainer);function Rx(e,{icon:t,color:r,text:n,langs:i}={}){return[_markdownitcontainer2.default,e,{render(o,s){let a=o[s],u=a.info.trim().slice(e.length).trim();if(a.nesting===1){if(e==="details")return`<details class="${e} custom-block">${`<summary>${u}</summary>`}
|
package/dist/node/cli.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkX57MD6QQcjs = require('../chunk-X57MD6QQ.cjs');exports.cli = _chunkX57MD6QQcjs.F; exports.run = _chunkX57MD6QQcjs.G;
|
package/dist/node/cli.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as a,G as b}from"../chunk-
|
|
1
|
+
import{F as a,G as b}from"../chunk-3CJLTSUY.mjs";export{a as cli,b as run};
|
package/dist/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkX57MD6QQcjs = require('../chunk-X57MD6QQ.cjs');exports.build = _chunkX57MD6QQcjs.C; exports.cli = _chunkX57MD6QQcjs.F; exports.createServer = _chunkX57MD6QQcjs.B; exports.defaultSiteConfig = _chunkX57MD6QQcjs.t; exports.defaultValaxyConfig = _chunkX57MD6QQcjs.u; exports.defineAddon = _chunkX57MD6QQcjs.n; exports.defineConfig = _chunkX57MD6QQcjs.s; exports.defineSiteConfig = _chunkX57MD6QQcjs.q; exports.defineTheme = _chunkX57MD6QQcjs.p; exports.defineUnoSetup = _chunkX57MD6QQcjs.v; exports.defineValaxyAddon = _chunkX57MD6QQcjs.m; exports.defineValaxyConfig = _chunkX57MD6QQcjs.r; exports.defineValaxyTheme = _chunkX57MD6QQcjs.o; exports.ensurePrefix = _chunkX57MD6QQcjs.d; exports.getGitTimestamp = _chunkX57MD6QQcjs.a; exports.getIndexHtml = _chunkX57MD6QQcjs.A; exports.isExternal = _chunkX57MD6QQcjs.b; exports.isPath = _chunkX57MD6QQcjs.f; exports.mergeValaxyConfig = _chunkX57MD6QQcjs.g; exports.mergeViteConfigs = _chunkX57MD6QQcjs.z; exports.postProcessForSSG = _chunkX57MD6QQcjs.E; exports.processValaxyOptions = _chunkX57MD6QQcjs.w; exports.resolveAddonConfig = _chunkX57MD6QQcjs.j; exports.resolveImportPath = _chunkX57MD6QQcjs.l; exports.resolveOptions = _chunkX57MD6QQcjs.x; exports.resolveThemeValaxyConfig = _chunkX57MD6QQcjs.y; exports.resolveValaxyConfig = _chunkX57MD6QQcjs.i; exports.resolveValaxyConfigFromRoot = _chunkX57MD6QQcjs.h; exports.run = _chunkX57MD6QQcjs.G; exports.slash = _chunkX57MD6QQcjs.c; exports.ssgBuild = _chunkX57MD6QQcjs.D; exports.toAtFS = _chunkX57MD6QQcjs.e; exports.transformObject = _chunkX57MD6QQcjs.k;
|
package/dist/node/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,B,C,D,E,F,G,a as o,b as r,c as m,d as p,e as t,f as e,g as f,h as x,i,j as a,k as b,l as c,m as d,n as g,o as h,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"../chunk-
|
|
1
|
+
import{A,B,C,D,E,F,G,a as o,b as r,c as m,d as p,e as t,f as e,g as f,h as x,i,j as a,k as b,l as c,m as d,n as g,o as h,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"../chunk-3CJLTSUY.mjs";export{C as build,F as cli,B as createServer,q as defaultSiteConfig,s as defaultValaxyConfig,g as defineAddon,n as defineConfig,k as defineSiteConfig,j as defineTheme,u as defineUnoSetup,d as defineValaxyAddon,l as defineValaxyConfig,h as defineValaxyTheme,p as ensurePrefix,o as getGitTimestamp,A as getIndexHtml,r as isExternal,e as isPath,f as mergeValaxyConfig,z as mergeViteConfigs,E as postProcessForSSG,v as processValaxyOptions,a as resolveAddonConfig,c as resolveImportPath,w as resolveOptions,y as resolveThemeValaxyConfig,i as resolveValaxyConfig,x as resolveValaxyConfigFromRoot,G as run,m as slash,D as ssgBuild,t as toAtFS,b as transformObject};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,151 +1,158 @@
|
|
|
1
1
|
export { D as DefaultThemeConfig, P as PartialDeep, R as RuntimeConfig, S as SiteConfig, b as SocialLink, U as UserSiteConfig, c as UserValaxyConfig, a as ValaxyAddon, V as ValaxyConfig } from '../config-4c49536b.js';
|
|
2
2
|
import 'medium-zoom';
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface PageFrontMatter extends Record<string, any> {
|
|
5
5
|
/**
|
|
6
6
|
* Path of post
|
|
7
7
|
* route.path
|
|
8
8
|
* @description 路径
|
|
9
9
|
*/
|
|
10
|
-
path
|
|
10
|
+
path: string;
|
|
11
11
|
/**
|
|
12
12
|
* Title
|
|
13
13
|
* @description 文章标题
|
|
14
14
|
*/
|
|
15
|
-
title
|
|
16
|
-
date
|
|
15
|
+
title: string;
|
|
16
|
+
date: string | number | Date;
|
|
17
17
|
/**
|
|
18
18
|
* Updated Time
|
|
19
19
|
*/
|
|
20
|
-
updated
|
|
21
|
-
|
|
20
|
+
updated: string | number | Date;
|
|
21
|
+
/**
|
|
22
|
+
* i18n
|
|
23
|
+
*/
|
|
24
|
+
lang: string;
|
|
22
25
|
/**
|
|
23
26
|
* TODO
|
|
24
27
|
* Read Time
|
|
25
28
|
* @description 阅读时长
|
|
26
29
|
*/
|
|
27
|
-
duration
|
|
28
|
-
/**
|
|
29
|
-
* post card type, can be bilibili/yuque/...
|
|
30
|
-
*/
|
|
31
|
-
type?: string;
|
|
32
|
-
/**
|
|
33
|
-
* override url, and jump directly
|
|
34
|
-
*/
|
|
35
|
-
url?: string;
|
|
36
|
-
/**
|
|
37
|
-
* @description 摘要
|
|
38
|
-
*/
|
|
39
|
-
excerpt?: string;
|
|
40
|
-
/**
|
|
41
|
-
* @default 'html'
|
|
42
|
-
* render type of excerpt
|
|
43
|
-
* - md: render as raw markdown
|
|
44
|
-
* - html: render as html
|
|
45
|
-
* - text: render as text
|
|
46
|
-
*/
|
|
47
|
-
excerpt_type?: 'md' | 'text' | 'html';
|
|
30
|
+
duration: string;
|
|
48
31
|
/**
|
|
49
32
|
* @description Author
|
|
50
33
|
* @description:zh-CN 作者
|
|
51
34
|
*/
|
|
52
|
-
author
|
|
35
|
+
author: string;
|
|
53
36
|
/**
|
|
54
37
|
* Display sponsor info
|
|
55
38
|
* @description 是否开启赞助
|
|
56
39
|
*/
|
|
57
|
-
sponsor
|
|
40
|
+
sponsor: boolean;
|
|
58
41
|
/**
|
|
59
42
|
* Copyright
|
|
60
43
|
* @description 是否显示文章底部版权信息
|
|
61
44
|
*/
|
|
62
|
-
copyright
|
|
45
|
+
copyright: boolean;
|
|
63
46
|
/**
|
|
64
|
-
*
|
|
65
|
-
* @description
|
|
66
|
-
*/
|
|
67
|
-
categories?: string | string[];
|
|
68
|
-
/**
|
|
69
|
-
* Tags
|
|
70
|
-
* @description 标签,可以有多个
|
|
47
|
+
* cover
|
|
48
|
+
* @description 封面图片
|
|
71
49
|
*/
|
|
72
|
-
|
|
50
|
+
cover: string;
|
|
73
51
|
/**
|
|
74
|
-
* display
|
|
75
|
-
* @description
|
|
52
|
+
* display toc
|
|
53
|
+
* @description 是否显示目录
|
|
76
54
|
*/
|
|
77
|
-
|
|
55
|
+
toc: boolean;
|
|
78
56
|
/**
|
|
79
57
|
* display right sidebar
|
|
80
58
|
* @description 是否显示右侧侧边栏
|
|
81
59
|
*/
|
|
82
|
-
aside
|
|
60
|
+
aside: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* enable markdown-body class
|
|
63
|
+
* @description 是否启用默认的 markdown 样式
|
|
64
|
+
*/
|
|
65
|
+
markdown: boolean;
|
|
83
66
|
/**
|
|
84
67
|
* icon before title
|
|
85
68
|
*/
|
|
86
|
-
icon
|
|
69
|
+
icon: string;
|
|
87
70
|
/**
|
|
88
71
|
* title color
|
|
89
72
|
*/
|
|
90
|
-
color
|
|
73
|
+
color: string;
|
|
91
74
|
/**
|
|
92
75
|
* display comment
|
|
93
76
|
*/
|
|
94
|
-
comment
|
|
77
|
+
comment: boolean;
|
|
95
78
|
/**
|
|
96
79
|
* post is end
|
|
97
80
|
* @description 是否完结,将在末尾添加衬线字体 Q.E.D.
|
|
98
81
|
*/
|
|
99
|
-
end
|
|
82
|
+
end: boolean;
|
|
100
83
|
/**
|
|
101
|
-
*
|
|
84
|
+
* use aplayer
|
|
102
85
|
*/
|
|
103
|
-
|
|
86
|
+
aplayer: boolean;
|
|
104
87
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @description 是否显示目录
|
|
88
|
+
* use katex
|
|
107
89
|
*/
|
|
108
|
-
|
|
90
|
+
katex: boolean;
|
|
109
91
|
/**
|
|
110
|
-
*
|
|
111
|
-
* @description 是否为草稿
|
|
92
|
+
* use codepen
|
|
112
93
|
*/
|
|
113
|
-
|
|
94
|
+
codepen: boolean;
|
|
114
95
|
/**
|
|
115
|
-
*
|
|
116
|
-
* -
|
|
117
|
-
* - `index`: hide in index
|
|
118
|
-
* @description 是否隐藏
|
|
96
|
+
* use medium-zoom
|
|
97
|
+
* @url https://github.com/francoischalifour/medium-zoom
|
|
119
98
|
*/
|
|
120
|
-
|
|
99
|
+
medium_zoom: boolean;
|
|
100
|
+
}
|
|
101
|
+
interface PostFrontMatter extends PageFrontMatter {
|
|
121
102
|
/**
|
|
122
|
-
*
|
|
123
|
-
* @description 封面图片
|
|
103
|
+
* post card type, can be bilibili/yuque/...
|
|
124
104
|
*/
|
|
125
|
-
|
|
105
|
+
type: string;
|
|
126
106
|
/**
|
|
127
|
-
*
|
|
128
|
-
* @description 是否启用默认的 markdown 样式
|
|
107
|
+
* override url, and jump directly
|
|
129
108
|
*/
|
|
130
|
-
|
|
109
|
+
url: string;
|
|
131
110
|
/**
|
|
132
|
-
*
|
|
111
|
+
* @description 摘要
|
|
133
112
|
*/
|
|
134
|
-
|
|
113
|
+
excerpt: string;
|
|
135
114
|
/**
|
|
136
|
-
*
|
|
115
|
+
* @default 'html'
|
|
116
|
+
* render type of excerpt
|
|
117
|
+
* - md: render as raw markdown
|
|
118
|
+
* - html: render as html
|
|
119
|
+
* - text: render as text
|
|
137
120
|
*/
|
|
138
|
-
|
|
121
|
+
excerpt_type: 'md' | 'text' | 'html';
|
|
139
122
|
/**
|
|
140
|
-
*
|
|
123
|
+
* Category
|
|
124
|
+
* @description 分类,若为数组,则按顺序代表多层文件夹
|
|
141
125
|
*/
|
|
142
|
-
|
|
126
|
+
categories: string | string[];
|
|
143
127
|
/**
|
|
144
|
-
*
|
|
145
|
-
* @
|
|
128
|
+
* Tags
|
|
129
|
+
* @description 标签,可以有多个
|
|
146
130
|
*/
|
|
147
|
-
|
|
131
|
+
tags: string[];
|
|
132
|
+
/**
|
|
133
|
+
* display prev next
|
|
134
|
+
* @description 是否显示前一篇、后一篇导航
|
|
135
|
+
*/
|
|
136
|
+
nav: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* 置顶
|
|
139
|
+
*/
|
|
140
|
+
top: number;
|
|
141
|
+
/**
|
|
142
|
+
* is draft
|
|
143
|
+
* @description 是否为草稿
|
|
144
|
+
*/
|
|
145
|
+
draft: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* hide in index
|
|
148
|
+
* - true/`all`: hide in index & archive
|
|
149
|
+
* - `index`: hide in index
|
|
150
|
+
* @description 是否隐藏
|
|
151
|
+
*/
|
|
152
|
+
hide: 'index' | boolean;
|
|
148
153
|
}
|
|
154
|
+
type Page = Partial<PageFrontMatter>;
|
|
155
|
+
type Post = Partial<PostFrontMatter>;
|
|
149
156
|
|
|
150
157
|
type CleanUrlsMode = 'disabled' | 'without-subfolders' | 'with-subfolders';
|
|
151
158
|
interface Header {
|
|
@@ -192,4 +199,4 @@ interface PageDataPayload {
|
|
|
192
199
|
}
|
|
193
200
|
type HeadConfig = [string, Record<string, string>] | [string, Record<string, string>, string];
|
|
194
201
|
|
|
195
|
-
export { CleanUrlsMode, HeadConfig, Header, PageData, PageDataPayload, Post };
|
|
202
|
+
export { CleanUrlsMode, HeadConfig, Header, Page, PageData, PageDataPayload, PageFrontMatter, Post, PostFrontMatter };
|
package/package.json
CHANGED
package/types/posts.ts
CHANGED
|
@@ -1,154 +1,165 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface PageFrontMatter extends Record<string, any> {
|
|
2
2
|
/**
|
|
3
3
|
* Path of post
|
|
4
4
|
* route.path
|
|
5
5
|
* @description 路径
|
|
6
6
|
*/
|
|
7
|
-
path
|
|
7
|
+
path: string
|
|
8
8
|
/**
|
|
9
9
|
* Title
|
|
10
10
|
* @description 文章标题
|
|
11
11
|
*/
|
|
12
|
-
title
|
|
13
|
-
date
|
|
12
|
+
title: string
|
|
13
|
+
date: string | number | Date
|
|
14
14
|
/**
|
|
15
15
|
* Updated Time
|
|
16
16
|
*/
|
|
17
|
-
updated
|
|
18
|
-
|
|
17
|
+
updated: string | number | Date
|
|
18
|
+
/**
|
|
19
|
+
* i18n
|
|
20
|
+
*/
|
|
21
|
+
lang: string
|
|
19
22
|
/**
|
|
20
23
|
* TODO
|
|
21
24
|
* Read Time
|
|
22
25
|
* @description 阅读时长
|
|
23
26
|
*/
|
|
24
|
-
duration
|
|
25
|
-
|
|
26
|
-
* post card type, can be bilibili/yuque/...
|
|
27
|
-
*/
|
|
28
|
-
type?: string
|
|
29
|
-
/**
|
|
30
|
-
* override url, and jump directly
|
|
31
|
-
*/
|
|
32
|
-
url?: string
|
|
33
|
-
/**
|
|
34
|
-
* @description 摘要
|
|
35
|
-
*/
|
|
36
|
-
excerpt?: string
|
|
37
|
-
/**
|
|
38
|
-
* @default 'html'
|
|
39
|
-
* render type of excerpt
|
|
40
|
-
* - md: render as raw markdown
|
|
41
|
-
* - html: render as html
|
|
42
|
-
* - text: render as text
|
|
43
|
-
*/
|
|
44
|
-
excerpt_type?: 'md' | 'text' | 'html'
|
|
27
|
+
duration: string
|
|
28
|
+
|
|
45
29
|
/**
|
|
46
30
|
* @description Author
|
|
47
31
|
* @description:zh-CN 作者
|
|
48
32
|
*/
|
|
49
|
-
author
|
|
33
|
+
author: string
|
|
50
34
|
|
|
51
35
|
/**
|
|
52
36
|
* Display sponsor info
|
|
53
37
|
* @description 是否开启赞助
|
|
54
38
|
*/
|
|
55
|
-
sponsor
|
|
39
|
+
sponsor: boolean
|
|
56
40
|
/**
|
|
57
41
|
* Copyright
|
|
58
42
|
* @description 是否显示文章底部版权信息
|
|
59
43
|
*/
|
|
60
|
-
copyright
|
|
44
|
+
copyright: boolean
|
|
61
45
|
|
|
62
46
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @description
|
|
47
|
+
* cover
|
|
48
|
+
* @description 封面图片
|
|
65
49
|
*/
|
|
66
|
-
|
|
50
|
+
cover: string
|
|
67
51
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @description
|
|
52
|
+
* display toc
|
|
53
|
+
* @description 是否显示目录
|
|
70
54
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
toc: boolean
|
|
73
56
|
/**
|
|
74
|
-
* display
|
|
75
|
-
* @description
|
|
57
|
+
* display right sidebar
|
|
58
|
+
* @description 是否显示右侧侧边栏
|
|
76
59
|
*/
|
|
77
|
-
|
|
60
|
+
aside: boolean
|
|
78
61
|
|
|
79
62
|
/**
|
|
80
|
-
*
|
|
81
|
-
* @description
|
|
63
|
+
* enable markdown-body class
|
|
64
|
+
* @description 是否启用默认的 markdown 样式
|
|
82
65
|
*/
|
|
83
|
-
|
|
66
|
+
markdown: boolean
|
|
84
67
|
|
|
85
68
|
/**
|
|
86
69
|
* icon before title
|
|
87
70
|
*/
|
|
88
|
-
icon
|
|
71
|
+
icon: string
|
|
89
72
|
/**
|
|
90
73
|
* title color
|
|
91
74
|
*/
|
|
92
|
-
color
|
|
75
|
+
color: string
|
|
93
76
|
/**
|
|
94
77
|
* display comment
|
|
95
78
|
*/
|
|
96
|
-
comment
|
|
79
|
+
comment: boolean
|
|
97
80
|
/**
|
|
98
81
|
* post is end
|
|
99
82
|
* @description 是否完结,将在末尾添加衬线字体 Q.E.D.
|
|
100
83
|
*/
|
|
101
|
-
end
|
|
84
|
+
end: boolean
|
|
102
85
|
|
|
86
|
+
// third-party features
|
|
103
87
|
/**
|
|
104
|
-
*
|
|
88
|
+
* use aplayer
|
|
89
|
+
*/
|
|
90
|
+
aplayer: boolean
|
|
91
|
+
/**
|
|
92
|
+
* use katex
|
|
93
|
+
*/
|
|
94
|
+
katex: boolean
|
|
95
|
+
/**
|
|
96
|
+
* use codepen
|
|
97
|
+
*/
|
|
98
|
+
codepen: boolean
|
|
99
|
+
/**
|
|
100
|
+
* use medium-zoom
|
|
101
|
+
* @url https://github.com/francoischalifour/medium-zoom
|
|
105
102
|
*/
|
|
106
|
-
|
|
103
|
+
medium_zoom: boolean
|
|
104
|
+
}
|
|
107
105
|
|
|
106
|
+
export interface PostFrontMatter extends PageFrontMatter {
|
|
108
107
|
/**
|
|
109
|
-
*
|
|
110
|
-
* @description 是否显示目录
|
|
108
|
+
* post card type, can be bilibili/yuque/...
|
|
111
109
|
*/
|
|
112
|
-
|
|
110
|
+
type: string
|
|
113
111
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @description 是否为草稿
|
|
112
|
+
* override url, and jump directly
|
|
116
113
|
*/
|
|
117
|
-
|
|
114
|
+
url: string
|
|
118
115
|
/**
|
|
119
|
-
*
|
|
120
|
-
* - true/`all`: hide in index & archive
|
|
121
|
-
* - `index`: hide in index
|
|
122
|
-
* @description 是否隐藏
|
|
116
|
+
* @description 摘要
|
|
123
117
|
*/
|
|
124
|
-
|
|
118
|
+
excerpt: string
|
|
125
119
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
120
|
+
* @default 'html'
|
|
121
|
+
* render type of excerpt
|
|
122
|
+
* - md: render as raw markdown
|
|
123
|
+
* - html: render as html
|
|
124
|
+
* - text: render as text
|
|
128
125
|
*/
|
|
129
|
-
|
|
126
|
+
excerpt_type: 'md' | 'text' | 'html'
|
|
127
|
+
|
|
130
128
|
/**
|
|
131
|
-
*
|
|
132
|
-
* @description
|
|
129
|
+
* Category
|
|
130
|
+
* @description 分类,若为数组,则按顺序代表多层文件夹
|
|
131
|
+
*/
|
|
132
|
+
categories: string | string[]
|
|
133
|
+
/**
|
|
134
|
+
* Tags
|
|
135
|
+
* @description 标签,可以有多个
|
|
133
136
|
*/
|
|
134
|
-
|
|
137
|
+
tags: string[]
|
|
135
138
|
|
|
136
|
-
// third-party features
|
|
137
139
|
/**
|
|
138
|
-
*
|
|
140
|
+
* display prev next
|
|
141
|
+
* @description 是否显示前一篇、后一篇导航
|
|
139
142
|
*/
|
|
140
|
-
|
|
143
|
+
nav: boolean
|
|
144
|
+
|
|
141
145
|
/**
|
|
142
|
-
*
|
|
146
|
+
* 置顶
|
|
143
147
|
*/
|
|
144
|
-
|
|
148
|
+
top: number
|
|
149
|
+
|
|
145
150
|
/**
|
|
146
|
-
*
|
|
151
|
+
* is draft
|
|
152
|
+
* @description 是否为草稿
|
|
147
153
|
*/
|
|
148
|
-
|
|
154
|
+
draft: boolean
|
|
149
155
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
156
|
+
* hide in index
|
|
157
|
+
* - true/`all`: hide in index & archive
|
|
158
|
+
* - `index`: hide in index
|
|
159
|
+
* @description 是否隐藏
|
|
152
160
|
*/
|
|
153
|
-
|
|
161
|
+
hide: 'index' | boolean
|
|
154
162
|
}
|
|
163
|
+
|
|
164
|
+
export type Page = Partial<PageFrontMatter>
|
|
165
|
+
export type Post = Partial<PostFrontMatter>
|