vuepress-plugin-coze
Version:
为Vuepress静态站点提供在线发布,编辑说说功能,支持图片上传,点赞,评论,用户登录,注册等功能 Provide online publishing, editing and talking functions for Vuepress static sites, support image upload, like, comment, user login, registration and other functions
78 lines (71 loc) • 2.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cozePlugin = void 0;
const { createPage } = require('@vuepress/core');
const utils_1 = require("@vuepress/utils");
const AV = require('leancloud-storage');
const vuepressPluginCoze = ({appId,appKey,masterKey,avatarPath,registerPath,onlyAdministrator }) => {
return {
onInitialized: async (app) => {
if (registerPath === undefined || registerPath === null) {
registerPath = "/aurora-register"
}
const AuroraCozePage = await createPage(app, {
//说说页面,默认
path: '/aurora-coze',
frontmatter: {
layout: 'CozeMood',
slug: 'aurora-coze-mood',
},
// 设置 markdown 内容
content: "",
})
const photoPage = await createPage(app, {
path: '/photo',
// 设置 frontmatter
frontmatter: {
layout: 'CozePhoto',
slug: 'aurora-photo',
},
// 设置 markdown 内容
content: "",
})
const AuroraCozeMood = await createPage(app, {
path: '/next-mood',
// 设置 frontmatter
frontmatter: {
layout: 'AuroraCozeMood',
slug: 'aurora-AuroraCozeMood',
},
// 设置 markdown 内容
content: "",
})
const RegisterUserPage = await createPage(app, {
//说说页面,默认
path: registerPath,
frontmatter: {
layout: 'RegisterUser',
slug: 'aurora-coze-register',
},
// 设置 markdown 内容
content: "",
})
// 把它添加到 `app.pages`
app.pages.push(AuroraCozePage)
app.pages.push(RegisterUserPage)
app.pages.push(photoPage)
app.pages.push(AuroraCozeMood)
},
define: {
__APP_ID__: appId,
__APP_KEY__: appKey,
__Master_Key__: masterKey,
__AVATAR_PATH__: avatarPath,
__ONLY_ADMINISTRATOR: onlyAdministrator
},
name: 'vuepress-plugin-coze',
multiple: false,
clientAppEnhanceFiles: utils_1.path.resolve(__dirname, '../client/clientAppEnhance.js')
};
};
exports.cozePlugin = vuepressPluginCoze;