# Plugin
Plugins generally add global-level functionality to MdPress. There is no strictly defined scope for a plugin.
# Examples
There are typically several types of plugins:
- Extend the page’s metadata generated at compile time. For example @mdpress/plugin-last-updated;
- Generate extra files before or after compilation. For example @mdpress/plugin-pwa;
- Inject global UI. For example @mdpress/plugin-back-to-top;
- Extend the CLI with custom commands. For example mdpress-plugin-export.
Here is also a little slightly complicated plugin example @mdpress/plugin-blog that uses compile-time metadata to generate some dynamic modules and initialize them on the client-side by using enhanceAppFiles
.
# Out of the Box
To keep things at a minimum, not all of the official plugins are shipped with MdPress. Here is the list of plugins that are pre-installed in the MdPress and the default theme, plugins that are not in the list below need to be installed manually(e.g. @mdpress/plugin-back-to-top).
# Plugins that come with MdPress
# Plugins that come with the default theme
- @mdpress/plugin-active-header-links
- @mdpress/plugin-nprogress
- @mdpress/plugin-search
- mdpress-plugin-container
- mdpress-plugin-smooth-scroll
# Architecture
The architecture of the whole plugin system is as follows: