Skip to content

Commit

Permalink
refactor(plugin-content-blog): remove ts build
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Nov 19, 2023
1 parent abe740f commit 12ca38e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 7,700 deletions.
26 changes: 26 additions & 0 deletions src/plugin/plugin-content-blog/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const blogPluginExports = require('@docusaurus/plugin-content-blog');
const { default: blogPlugin } = blogPluginExports;

async function blogPluginEnhanced(context, options) {
const blogPluginInstance = await blogPlugin(context, options);

return {
...blogPluginInstance,
async contentLoaded({ content, allContent, actions }) {
// Create default plugin pages
await blogPluginInstance.contentLoaded({ content, allContent, actions });

// Create your additional pages
const { blogPosts, blogTags } = content;
const { setGlobalData } = actions;

setGlobalData({
blogs: blogPosts,
tags: blogTags,
});
},
};
}

module.exports = Object.assign({}, blogPluginExports, { default: blogPluginEnhanced });
32 changes: 0 additions & 32 deletions src/plugin/plugin-content-blog/lib/index.js

This file was deleted.

50 changes: 0 additions & 50 deletions src/plugin/plugin-content-blog/package.json

This file was deleted.

Loading

1 comment on commit 12ca38e

@vercel
Copy link

@vercel vercel bot commented on 12ca38e Nov 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

blog – ./

blog-kuizuo1.vercel.app
blog-kuizuo.vercel.app
blog-git-main-kuizuo1.vercel.app
kuizuo.cn

Please sign in to comment.