Plugins
Since the release of version 0.39.0, Publii has included support for Plugins, providing additional features that go beyond the basic functionalities provided by the default install of the app.
What is a plugin?
A plugin is, in simple terms, an extra bit of code that performs a specific action that can be added to an existing application to add extra features or functions. For example, whereas a default Publii site doesn't include an option for allowing users to post comments on articles, by installing the 'Facebook Comments plugin' you can enable adding comments to posts via the user's Facebook account. The plugin extends, or adds to, the base features of Publii.
So why aren't the extra options and features available through the plugins already included in the base Publii installation? As a rule, Publii is developed to be a simple, easy-to-install and easy-to-use tool for building websites; every time a new feature is added, the complexity of the app and its install size increases, as does the size of the files it generates for the static that is then uploaded to the server. By separating out additional features into plugins, users can customize their installation to use only the features they need, saving install space, and reducing bloat in their website files to maximise load times and efficiency.
Installing Plugins
Since plugins are not included in Publii by default in order to reduce the install size, you’ll need to download any that you wish to use on your site. To do so, follow these steps:
- Open Publii’s App Menu by clicking on the three dots icon in the top-right of the app UI; this icon is always visible except when creating or editing a new post, tag or menu.
- In the menu that appears, click on Plugins. This will take you to the Plugins page where you can see any plugins that you have installed.
- It’s probably looking quite bare at the moment, so let’s download a plugin. Click on the Get More Plugins box to open your browser at the Publii Plugins Marketplace, which displays all the currently available plugins.
- Select the plugin you wish to use, then click on it to open the description page. From here, you can click the Download button under the description to download the zipped install package.
- Once the download has finished, in the Plugins screen of the Publii app, click on the Install Plugin button at the top of the page. This will open your file explorer; browse to the folder where you downloaded your plugin, and select it. Publii will automatically install the plugin and add it to the list of available plugins in both the Plugins and Tools & Plugins pages in Publii.
Enabling Plugins
Each plugin listed in the Tools & Plugins section of Publii can be individually enabled or disabled by clicking the switcher button in the bottom-left of the plugin box of the plugin you wish to use. If the switcher changes from grey to blue. then the plugin is enabled. However, though the plugin is enabled, there may be some options that must be configured before the plugin can be used e.g. if using a comments plugin, then comments must be enabled etc...
If a plugin requires additional options to be configured, this will be noted in the section of this guide that is specific to that plugin.
Uninstalling a Plugin
If you no longer want to use a plugin and need to free up space, you can uninstall a plugin completely from your Publii installation. To do so, open the Plugins page by clicking on the Three dots icon > Plugins option to open the Plugin page. In the list of installed plugins, find the plugin you no longer need and click the Trash Icon to the right of its name. You will be asked to confirm deletion; clicking the OK button will uninstall the plugin from Publii.