Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vuepress-plugin-blog2

Package Overview
Dependencies
Maintainers
1
Versions
300
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuepress-plugin-blog2 - npm Package Compare versions

Comparing version 2.0.0-beta.47 to 2.0.0-beta.49

2

lib/client/index.js

@@ -1,2 +0,2 @@

import{resolveRouteWithRedirect as t}from"@mr-hope/vuepress-shared/lib/client";import{categoryMap as o}from"@temp/blog/category";import{useRouteLocale as e,usePageFrontmatter as a}from"@vuepress/client";import{ref as n,computed as r}from"vue";import{useRouter as p,useRoute as i}from"vue-router";import{typeMap as m}from"@temp/blog/type";const s=n(o),u=(o="")=>{const n=p(),m=i(),u=e();return r((()=>{var e;const r=o||(null===(e=a().value.blog)||void 0===e?void 0:e.key)||"",p=n.getRoutes();if(!s.value[r])throw new Error("useBlogCategory: "+(o?`key ${o} is invalid`:"can not bind to an exisiting key on non blog pages"));const i=s.value[r][u.value],l={path:i.path,map:{}};for(const o in i.map){const e=i.map[o];l.map[o]={path:e.path,items:[]};for(const a of e.keys){const e=p.find((({name:t})=>t===a));if(e){const a=t(n,e.path);l.map[o].items.push({path:a.path,info:""===BLOG_META_SCOPE?a.meta:a.meta[BLOG_META_SCOPE]})}}m.path===e.path&&(l.currentItems=l.map[o].items)}return l}))};(import.meta.webpackHot||import.meta.hot)&&(__VUE_HMR_RUNTIME__.updateBlogCategory=t=>{s.value=t});const l=n(m),c=(o="")=>{const n=p(),i=e();return r((()=>{var e;const r=o||(null===(e=a().value.blog)||void 0===e?void 0:e.key)||"";if(!l.value[r])throw new Error("useBlogType: "+(o?`key ${o} is invalid`:"can not bind to an exisiting key on non blog pages"));const p=n.getRoutes(),m=l.value[r][i.value],s={path:m.path,items:[]};for(const o of m.keys){const e=p.find((({name:t})=>t===o));if(e){const o=t(n,e.path);s.items.push({path:o.path,info:""===BLOG_META_SCOPE?o.meta:o.meta[BLOG_META_SCOPE]})}}return s}))};(import.meta.webpackHot||import.meta.hot)&&(__VUE_HMR_RUNTIME__.updateBlogType=t=>{l.value=t});export{s as blogCategoryMap,l as blogTypeMap,u as useBlogCategory,c as useBlogType};
import{resolveRouteWithRedirect as t}from"@mr-hope/vuepress-shared/lib/client";import{categoryMap as e}from"@temp/blog/category";import{useRouteLocale as o,usePageFrontmatter as a}from"@vuepress/client";import{ref as n,computed as p}from"vue";import{useRouter as r,useRoute as i}from"vue-router";import{typeMap as m}from"@temp/blog/type";const s=n(e),u=(e="")=>{const n=r(),m=i(),u=o();return p((()=>{const o=e||a().value.blog?.key||"",p=n.getRoutes();if(!s.value[o])throw new Error("useBlogCategory: "+(e?`key ${e} is invalid`:"can not bind to an exisiting key on non blog pages"));const r=s.value[o][u.value],i={path:r.path,map:{}};for(const e in r.map){const o=r.map[e];i.map[e]={path:o.path,items:[]};for(const a of o.keys){const o=p.find((({name:t})=>t===a));if(o){const a=t(n,o.path);i.map[e].items.push({path:a.path,info:""===BLOG_META_SCOPE?a.meta:a.meta[BLOG_META_SCOPE]})}}m.path===o.path&&(i.currentItems=i.map[e].items)}return i}))};(import.meta.webpackHot||import.meta.hot)&&(__VUE_HMR_RUNTIME__.updateBlogCategory=t=>{s.value=t});const l=n(m),c=(e="")=>{const n=r(),i=o();return p((()=>{const o=e||a().value.blog?.key||"";if(!l.value[o])throw new Error("useBlogType: "+(e?`key ${e} is invalid`:"can not bind to an exisiting key on non blog pages"));const p=n.getRoutes(),r=l.value[o][i.value],m={path:r.path,items:[]};for(const e of r.keys){const o=p.find((({name:t})=>t===e));if(o){const e=t(n,o.path);m.items.push({path:e.path,info:""===BLOG_META_SCOPE?e.meta:e.meta[BLOG_META_SCOPE]})}}return m}))};(import.meta.webpackHot||import.meta.hot)&&(__VUE_HMR_RUNTIME__.updateBlogType=t=>{l.value=t});export{s as blogCategoryMap,l as blogTypeMap,u as useBlogCategory,c as useBlogType};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import { Page, Plugin, PluginConfig } from '@vuepress/core';
import { Page, PluginObject } from '@vuepress/core';
import { BasePageFrontMatter } from '@mr-hope/vuepress-shared';

@@ -112,3 +112,3 @@

*/
frontmatter?: (localePath: string) => Record<string, string>;
frontmatter?: (localePath: string) => Record<string, unknown>;
/**

@@ -139,3 +139,3 @@ * Item page path pattern or custom function to be registered

*/
itemFrontmatter?: (name: string, localePath: string) => Record<string, string>;
itemFrontmatter?: (name: string, localePath: string) => Record<string, unknown>;
}

@@ -182,3 +182,3 @@ interface BlogTypeOptions {

*/
frontmatter?: (localePath: string) => Record<string, string>;
frontmatter?: (localePath: string) => Record<string, unknown>;
}

@@ -306,5 +306,4 @@ interface BlogOptions {

declare const blogPlugin: Plugin<BlogOptions>;
declare const blog: (options: BlogOptions | false) => PluginConfig<BlogOptions>;
declare const blogPlugin: (options: BlogOptions) => PluginObject;
export { Article, ArticleMap, BlogCategoryData, BlogCategoryFrontmatterOptions, BlogCategoryOptions, BlogOptions, BlogPluginCategoryFrontmatter, BlogPluginFrontmatter, BlogPluginTypeFrontmatter, BlogTypeData, BlogTypeFrontmatterOptions, BlogTypeOptions, CategoryConfig, CategoryLocaleConfig, CategoryLocaleMap, CategoryMap, PageMap, TypeConfig, TypeMap, blog, blogPlugin, blogPlugin as default };
export { Article, ArticleMap, BlogCategoryData, BlogCategoryFrontmatterOptions, BlogCategoryOptions, BlogOptions, BlogPluginCategoryFrontmatter, BlogPluginFrontmatter, BlogPluginTypeFrontmatter, BlogTypeData, BlogTypeFrontmatterOptions, BlogTypeOptions, CategoryConfig, CategoryLocaleConfig, CategoryLocaleMap, CategoryMap, PageMap, TypeConfig, TypeMap, blogPlugin, blogPlugin as default };

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mr-hope/vuepress-shared"),t=require("@vuepress/core"),a=require("chokidar"),n=require("@vuepress/shared");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(a);const p=new e.Logger("vuepress-plugin-blog2"),s=(e,t)=>{const a={};return Object.keys({"/":{},...t.options.locales}).forEach((e=>{a[e]=[]})),t.pages.filter(e).forEach((e=>{a[e.pathLocale].push(e)})),a},i=(e,a,o,r=!1)=>{const{category:s=[],slugify:i=(e=>e.replace(/[ _]/g,"-").toLowerCase())}=a;return Promise.all(s.map((async({key:a,getter:s,sorter:g=(()=>-1),path:l="/:key/",layout:u="Layout",frontmatter:c=(()=>({})),itemPath:y="/:key/:name/",itemLayout:f="Layout",itemFrontmatter:h=(()=>({}))},m)=>{if("string"!=typeof a||!a)return p.error(`Invalid 'key' option ${a} in 'category[${m}]'`),null;if("function"!=typeof s)return p.error(`Invalid 'getter' option in 'category[${m}]', it should be a function!`),null;e.env.isDebug&&p.info(`Generating ${a} category.\n`);const d={},k=[],_="function"==typeof y?y:e=>(y||"").replace(/:key/g,i(a)).replace(/:name/g,i(e));for(const y in o){if(l){const o=`${y}${n.removeLeadingSlash(l.replace(/:key/g,i(a)))}`,s=await t.createPage(e,{path:o,frontmatter:{...c(y),blog:{type:"category",key:a},layout:u}}),g=e.pages.findIndex((({path:e})=>e===o));-1===g?e.pages.push(s):e.pages[g].key!==s.key&&(e.pages.splice(g,1,s),r&&p.warn(`Overiding existed path ${o}`)),k.push(s.key),d[y]={path:s.path,map:{}}}else d[y]={path:"",map:{}};const{map:m}=d[y],$={};for(const i of o[y]){const o=s(i);for(const s of o){if(!m[s]){const o=_(s);if(o){const i=`${y}${n.removeLeadingSlash(o)}`,g=await t.createPage(e,{path:`${y}${n.removeLeadingSlash(o)}`,frontmatter:{...h(s,y),blog:{type:"category",name:s,key:a},layout:f}}),l=e.pages.findIndex((({path:e})=>e===i));-1===l?e.pages.push(g):e.pages[l].key!==g.key&&(e.pages.splice(l,1,g),r&&p.warn(`Overiding existed path ${i}`)),k.push(g.key),m[s]={path:g.path,keys:[]}}else m[s]={path:"",keys:[]};$[s]=[]}$[s].push(i)}}for(const e in $)m[e].keys=$[e].sort(g).map((({key:e})=>e));if(e.env.isDebug){let e=`Route ${y} in ${a} cateogry:\n`;for(const t in m){const{path:a,keys:n}=m[t];e+=`name: ${t}; ${a?`path: ${a}; `:""}items: ${n.length}\n`}p.info(e)}}return{key:a,map:d,pageKeys:k}}))).then((async t=>{const a={},n=[];return t.filter((e=>null!==e)).forEach((({key:e,map:t,pageKeys:o})=>{a[e]=t,n.push(...o)})),await e.writeTemp("blog/category.js",`export const categoryMap = ${JSON.stringify(a)}\n\nif (import.meta.webpackHot) {\n import.meta.webpackHot.accept()\n if (__VUE_HMR_RUNTIME__.updateBlogCategory) {\n __VUE_HMR_RUNTIME__.updateBlogCategory(categoryMap)\n }\n}\n\nif (import.meta.hot) {\n import.meta.hot.accept(({ categoryMap }) => {\n __VUE_HMR_RUNTIME__.updateBlogCategory(categoryMap)\n })\n}\n`),e.env.isDebug&&p.info("All categories generated."),n}))},g=(e,a,o,r=!1)=>{const{type:s=[],slugify:i=(e=>e.replace(/[ _]/g,"-").toLowerCase())}=a;return Promise.all(s.map((async({key:a,sorter:s=(()=>-1),filter:g=(()=>!0),path:l="/:key/",layout:u="Layout",frontmatter:c=(()=>({}))},y)=>{if("string"!=typeof a||!a)return p.error(`Invalid 'key' option ${a} in 'category[${y}]'`),null;const f={},h=[];e.env.isDebug&&p.info(`Generating ${a} type.\n`);for(const y in o){const m=o[y].filter(g).sort(s).map((({key:e})=>e));if(l){const o=`${y}${n.removeLeadingSlash(i(l.replace(/:key/g,a)))}`,s=await t.createPage(e,{path:o,frontmatter:{...c(y),blog:{type:"type",key:a},layout:u}}),g=e.pages.findIndex((({path:e})=>e===o));-1===g?e.pages.push(s):e.pages[g].key!==s.key&&(e.pages.splice(g,1,s),r&&p.warn(`Overiding existed path ${o}`)),h.push(s.key),f[y]={path:s.path,keys:m},e.env.isDebug&&p.info(`Route ${y} in ${a} type: path: ${s.path}; items: ${m.length}\n`)}else f[y]={path:"",keys:m},e.env.isDebug&&p.info(`Route ${y} in ${a} type: items: ${m.length}\n`)}return{key:a,map:f,pageKeys:h}}))).then((async t=>{const a={},n=[];return t.filter((e=>null!==e)).forEach((({key:e,map:t,pageKeys:o})=>{a[e]=t,n.push(...o)})),await e.writeTemp("blog/type.js",`export const typeMap = ${JSON.stringify(a)}\n\nif (import.meta.webpackHot) {\n import.meta.webpackHot.accept()\n if (__VUE_HMR_RUNTIME__.updateBlogType) {\n __VUE_HMR_RUNTIME__.updateBlogType(typeMap)\n }\n}\n\nif (import.meta.hot) {\n import.meta.hot.accept(({ typeMap }) => {\n __VUE_HMR_RUNTIME__.updateBlogType(typeMap)\n })\n}\n`),e.env.isDebug&&p.info("All types generated."),n}))},l=a=>{const{getInfo:n=(()=>({})),filter:o=(e=>Boolean(e.filePathRelative)&&!e.frontmatter.home),metaScope:l="_blog"}=a;let u=[];return{name:"vuepress-plugin-blog2",define:()=>({BLOG_META_SCOPE:l}),extendsPage:e=>{o(e)&&(e.routeMeta={...""===l?n(e):{[l]:n(e)},...e.routeMeta})},onInitialized:t=>{e.addViteSsrNoExternal(t,["@mr-hope/vuepress-shared","vuepress-plugin-blog2"]),e.addViteOptimizeDepsExclude(t,"vuepress-plugin-blog2");const n=s(o,t);return Promise.all([i(t,a,n,!0).then((e=>{u.push(...e)})),g(t,a,n,!0).then((e=>{u.push(...e)}))]).then((()=>{t.env.isDebug&&p.info("temp file generated")}))},onWatched:(e,n)=>{if(a.hotReload){const l=r.default.watch("pages/**/*.js",{cwd:e.dir.temp(),ignoreInitial:!0}),c=()=>{const n=[],r=s(o,e);return Promise.all([i(e,a,r).then((e=>{n.push(...e)})),g(e,a,r).then((e=>{n.push(...e)}))]).then((async()=>{const a=u.filter((e=>!n.includes(e))),o=n.filter((e=>!u.includes(e)));o.length&&(e.env.isDebug&&p.info(`New pages detected: ${o.toString()}`),await Promise.all(o.map((async a=>{await t.preparePageComponent(e,e.pages.find((({key:e})=>e===a))),await t.preparePageData(e,e.pages.find((({key:e})=>e===a)))})))),a.length&&(e.env.isDebug&&p.info(`Removing following pages: ${a.toString()}`),a.forEach((t=>{e.pages.splice(e.pages.findIndex((({key:e})=>e===t)),1)}))),(a.length||o.length)&&(await t.preparePagesComponents(e),await t.preparePagesData(e),await t.preparePagesRoutes(e)),u=n,e.env.isDebug&&p.info("temp file updated")}))};l.on("add",(()=>{c()})),l.on("change",(()=>{c()})),l.on("unlink",(()=>{c()})),n.push(l)}}}};exports.blog=e=>["blog2",e],exports.blogPlugin=l,exports.default=l;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@vuepress/core"),t=require("chokidar"),a=require("@vuepress/shared"),n=require("@mr-hope/vuepress-shared");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(t);const p=new n.Logger("vuepress-plugin-blog2"),i=(e,t)=>{const a={};return Object.keys({"/":{},...t.options.locales}).forEach((e=>{a[e]=[]})),t.pages.filter(e).forEach((e=>{a[e.pathLocale].push(e)})),a},s=(t,n,o,r=!1)=>{const{category:i=[],slugify:s=(e=>e.replace(/[ _]/g,"-").toLowerCase())}=n;return Promise.all(i.map((async({key:n,getter:i,sorter:g=(()=>-1),path:l="/:key/",layout:y="Layout",frontmatter:c=(()=>({})),itemPath:u="/:key/:name/",itemLayout:f="Layout",itemFrontmatter:h=(()=>({}))},m)=>{if("string"!=typeof n||!n)return p.error(`Invalid 'key' option ${n} in 'category[${m}]'`),null;if("function"!=typeof i)return p.error(`Invalid 'getter' option in 'category[${m}]', it should be a function!`),null;t.env.isDebug&&p.info(`Generating ${n} category.\n`);const d={},k=[],_="function"==typeof u?u:e=>(u||"").replace(/:key/g,s(n)).replace(/:name/g,s(e));for(const u in o){if(l){const o=`${u}${a.removeLeadingSlash(l.replace(/:key/g,s(n)))}`,i=await e.createPage(t,{path:o,frontmatter:{...c(u),blog:{type:"category",key:n},layout:y}}),g=t.pages.findIndex((({path:e})=>e===o));-1===g?t.pages.push(i):t.pages[g].key!==i.key&&(t.pages.splice(g,1,i),r&&p.warn(`Overiding existed path ${o}`)),k.push(i.key),d[u]={path:i.path,map:{}}}else d[u]={path:"",map:{}};const{map:m}=d[u],$={};for(const s of o[u]){const o=i(s);for(const i of o){if(!m[i]){const o=_(i);if(o){const s=`${u}${a.removeLeadingSlash(o)}`,g=await e.createPage(t,{path:`${u}${a.removeLeadingSlash(o)}`,frontmatter:{...h(i,u),blog:{type:"category",name:i,key:n},layout:f}}),l=t.pages.findIndex((({path:e})=>e===s));-1===l?t.pages.push(g):t.pages[l].key!==g.key&&(t.pages.splice(l,1,g),r&&p.warn(`Overiding existed path ${s}`)),k.push(g.key),m[i]={path:g.path,keys:[]}}else m[i]={path:"",keys:[]};$[i]=[]}$[i].push(s)}}for(const e in $)m[e].keys=$[e].sort(g).map((({key:e})=>e));if(t.env.isDebug){let e=`Route ${u} in ${n} cateogry:\n`;for(const t in m){const{path:a,keys:n}=m[t];e+=`name: ${t}; ${a?`path: ${a}; `:""}items: ${n.length}\n`}p.info(e)}}return{key:n,map:d,pageKeys:k}}))).then((async e=>{const a={},n=[];return e.filter((e=>null!==e)).forEach((({key:e,map:t,pageKeys:o})=>{a[e]=t,n.push(...o)})),await t.writeTemp("blog/category.js",`export const categoryMap = ${JSON.stringify(a)}\n\nif (import.meta.webpackHot) {\n import.meta.webpackHot.accept()\n if (__VUE_HMR_RUNTIME__.updateBlogCategory) {\n __VUE_HMR_RUNTIME__.updateBlogCategory(categoryMap)\n }\n}\n\nif (import.meta.hot) {\n import.meta.hot.accept(({ categoryMap }) => {\n __VUE_HMR_RUNTIME__.updateBlogCategory(categoryMap)\n })\n}\n`),t.env.isDebug&&p.info("All categories generated."),n}))},g=(t,n,o,r=!1)=>{const{type:i=[],slugify:s=(e=>e.replace(/[ _]/g,"-").toLowerCase())}=n;return Promise.all(i.map((async({key:n,sorter:i=(()=>-1),filter:g=(()=>!0),path:l="/:key/",layout:y="Layout",frontmatter:c=(()=>({}))},u)=>{if("string"!=typeof n||!n)return p.error(`Invalid 'key' option ${n} in 'category[${u}]'`),null;const f={},h=[];t.env.isDebug&&p.info(`Generating ${n} type.\n`);for(const u in o){const m=o[u].filter(g).sort(i).map((({key:e})=>e));if(l){const o=`${u}${a.removeLeadingSlash(s(l.replace(/:key/g,n)))}`,i=await e.createPage(t,{path:o,frontmatter:{...c(u),blog:{type:"type",key:n},layout:y}}),g=t.pages.findIndex((({path:e})=>e===o));-1===g?t.pages.push(i):t.pages[g].key!==i.key&&(t.pages.splice(g,1,i),r&&p.warn(`Overiding existed path ${o}`)),h.push(i.key),f[u]={path:i.path,keys:m},t.env.isDebug&&p.info(`Route ${u} in ${n} type: path: ${i.path}; items: ${m.length}\n`)}else f[u]={path:"",keys:m},t.env.isDebug&&p.info(`Route ${u} in ${n} type: items: ${m.length}\n`)}return{key:n,map:f,pageKeys:h}}))).then((async e=>{const a={},n=[];return e.filter((e=>null!==e)).forEach((({key:e,map:t,pageKeys:o})=>{a[e]=t,n.push(...o)})),await t.writeTemp("blog/type.js",`export const typeMap = ${JSON.stringify(a)}\n\nif (import.meta.webpackHot) {\n import.meta.webpackHot.accept()\n if (__VUE_HMR_RUNTIME__.updateBlogType) {\n __VUE_HMR_RUNTIME__.updateBlogType(typeMap)\n }\n}\n\nif (import.meta.hot) {\n import.meta.hot.accept(({ typeMap }) => {\n __VUE_HMR_RUNTIME__.updateBlogType(typeMap)\n })\n}\n`),t.env.isDebug&&p.info("All types generated."),n}))},l=t=>{const{getInfo:a=(()=>({})),filter:n=(e=>Boolean(e.filePathRelative)&&!e.frontmatter.home),metaScope:o="_blog"}=t;let l=[];return{name:"vuepress-plugin-blog2",define:()=>({BLOG_META_SCOPE:o}),extendsPage:e=>{n(e)&&(e.routeMeta={...""===o?a(e):{[o]:a(e)},...e.routeMeta})},onInitialized:e=>{const a=i(n,e);return Promise.all([s(e,t,a,!0).then((e=>{l.push(...e)})),g(e,t,a,!0).then((e=>{l.push(...e)}))]).then((()=>{e.env.isDebug&&p.info("temp file generated")}))},onWatched:(a,o)=>{if(t.hotReload){const y=r.default.watch("pages/**/*.js",{cwd:a.dir.temp(),ignoreInitial:!0}),c=()=>{const o=[],r=i(n,a);return Promise.all([s(a,t,r).then((e=>{o.push(...e)})),g(a,t,r).then((e=>{o.push(...e)}))]).then((async()=>{const t=l.filter((e=>!o.includes(e))),n=o.filter((e=>!l.includes(e)));n.length&&(a.env.isDebug&&p.info(`New pages detected: ${n.toString()}`),await Promise.all(n.map((async t=>{await e.preparePageComponent(a,a.pages.find((({key:e})=>e===t))),await e.preparePageData(a,a.pages.find((({key:e})=>e===t)))})))),t.length&&(a.env.isDebug&&p.info(`Removing following pages: ${t.toString()}`),t.forEach((e=>{a.pages.splice(a.pages.findIndex((({key:t})=>t===e)),1)}))),(t.length||n.length)&&(await e.preparePagesComponents(a),await e.preparePagesData(a),await e.preparePagesRoutes(a)),l=o,a.env.isDebug&&p.info("temp file updated")}))};y.on("add",(()=>{c()})),y.on("change",(()=>{c()})),y.on("unlink",(()=>{c()})),o.push(y)}}}};exports.blogPlugin=l,exports.default=l;
//# sourceMappingURL=index.js.map
{
"name": "vuepress-plugin-blog2",
"version": "2.0.0-beta.47",
"version": "2.0.0-beta.49",
"description": "Blog plugin for VuePress",

@@ -32,21 +32,23 @@ "keywords": [

],
"scripts": {
"build": "rollup -c",
"clean": "rimraf ./lib ./*.tsbuildinfo",
"dev": "yarn dev:ts",
"dev:ts": "tsc -b tsconfig.build.json --watch"
},
"dependencies": {
"@mr-hope/vuepress-shared": "2.0.0-beta.47",
"@vuepress/client": "2.0.0-beta.38",
"@vuepress/core": "2.0.0-beta.38",
"@vuepress/shared": "2.0.0-beta.38",
"@mr-hope/vuepress-shared": "2.0.0-beta.49",
"@vuepress/client": "2.0.0-beta.43",
"@vuepress/core": "2.0.0-beta.43",
"@vuepress/shared": "2.0.0-beta.43",
"chokidar": "^3.5.3",
"vue": "^3.2.32",
"vue": "^3.2.33",
"vue-router": "^4.0.14"
},
"devDependencies": {
"rimraf": "3.0.2"
},
"publishConfig": {
"access": "public"
},
"gitHead": "413cb0deade1ad4753ead951c5426acd5950941c"
}
"scripts": {
"build": "rollup -c",
"clean": "rimraf ./lib ./*.tsbuildinfo",
"dev": "pnpm dev:ts",
"dev:ts": "tsc -b tsconfig.build.json --watch"
}
}

@@ -19,11 +19,10 @@ <!-- markdownlint-disable -->

```bash
yarn add vuepress-plugin-blog2@next
# pnpm
pnpm add -D vuepress-plugin-blog2@next
# npm
npm i -D vuepress-plugin-blog2@next
# yarn
yarn add -D vuepress-plugin-blog2@next
```
Or
```bash
npm i vuepress-plugin-blog2@next
```
---

@@ -34,9 +33,8 @@

```bash
yarn add vuepress-plugin-blog2@next
# pnpm
pnpm add -D vuepress-plugin-blog2@next
# npm
npm i -D vuepress-plugin-blog2@next
# yarn
yarn add -D vuepress-plugin-blog2@next
```
```bash
npm i vuepress-plugin-blog2@next
```
import {
addViteSsrNoExternal,
addViteOptimizeDepsExclude,
} from "@mr-hope/vuepress-shared";
import {
preparePageComponent,

@@ -18,6 +14,6 @@ preparePageData,

import type { Plugin, PluginConfig } from "@vuepress/core";
import type { PluginObject } from "@vuepress/core";
import type { BlogOptions } from "../shared";
export const blogPlugin: Plugin<BlogOptions> = (options) => {
export const blogPlugin = (options: BlogOptions): PluginObject => {
const {

@@ -50,8 +46,2 @@ getInfo = (): Record<string, never> => ({}),

onInitialized: (app): Promise<void> => {
addViteSsrNoExternal(app, [
"@mr-hope/vuepress-shared",
"vuepress-plugin-blog2",
]);
addViteOptimizeDepsExclude(app, "vuepress-plugin-blog2");
const pageMap = getPageMap(filter, app);

@@ -162,5 +152,1 @@

};
export const blog = (
options: BlogOptions | false
): PluginConfig<BlogOptions> => ["blog2", options];

@@ -84,3 +84,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

*/
frontmatter?: (localePath: string) => Record<string, string>;
frontmatter?: (localePath: string) => Record<string, unknown>;

@@ -117,3 +117,3 @@ /**

localePath: string
) => Record<string, string>;
) => Record<string, unknown>;
}

@@ -197,3 +197,3 @@

*/
frontmatter?: (localePath: string) => Record<string, string>;
frontmatter?: (localePath: string) => Record<string, unknown>;
}

@@ -200,0 +200,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc