All Projects → getgrav → grav-plugin-maintenance

getgrav / grav-plugin-maintenance

Licence: MIT license
Grav Maintenance Plugin

Programming Languages

PHP
23972 projects - #3 most used programming language
Twig
543 projects

Projects that are alternatives of or similar to grav-plugin-maintenance

grav-plugin-themer
This plugin enables you use different themes on one site individual set per page or collection.
Stars: ✭ 16 (+33.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-markdown-notices
Grav Markdown Notices Plugin
Stars: ✭ 31 (+158.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-shortcode-ui
Grav Shortcode UI Plugin
Stars: ✭ 45 (+275%)
Mutual labels:  grav, grav-plugin
grav-plugin-jscomments
JSComments is a Grav (http://github.com/getgrav/grav) plugin which allows to integrate comments into individual pages from Discourse / Disqus / Facebook / Google+ / HyperComments / IntenseDebate / Isso, and Muut comment systems.
Stars: ✭ 28 (+133.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-shortcode-core
Grav Shortcode Core Plugin
Stars: ✭ 42 (+250%)
Mutual labels:  grav, grav-plugin
grav-plugin-sitemap
Grav Sitemap Plugin
Stars: ✭ 34 (+183.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-proposal
Sales Proposal Plugin for Grav
Stars: ✭ 16 (+33.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-api
A REST API plugin for GravCMS
Stars: ✭ 24 (+100%)
Mutual labels:  grav, grav-plugin
grav-plugin-login
Grav Login Plugin
Stars: ✭ 40 (+233.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-taxonomylist
Grav TaxonomyList Plugin
Stars: ✭ 19 (+58.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-youtube
Grav YouTube Plugin
Stars: ✭ 21 (+75%)
Mutual labels:  grav, grav-plugin
grav-plugin-form
Grav Form Plugin
Stars: ✭ 48 (+300%)
Mutual labels:  grav, grav-plugin
grav-plugin-instagram
Instagram is a simple plugin that includes Instagram feed to your Grav website.
Stars: ✭ 13 (+8.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-data-manager
Grav Data Manager Plugin
Stars: ✭ 28 (+133.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-devtools
Grav Devtools Plugin
Stars: ✭ 36 (+200%)
Mutual labels:  grav, grav-plugin
grav-plugin-readingtime
Grav ReadingTime Plugin
Stars: ✭ 19 (+58.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-langswitcher
Grav LangSwitcher Plugin
Stars: ✭ 22 (+83.33%)
Mutual labels:  grav, grav-plugin
grav-plugin-mathjax
This plugin allows you to include math formulas in your web pages, either using TeX and LaTeX notation, and/or as MathML.
Stars: ✭ 18 (+50%)
Mutual labels:  grav, grav-plugin
grav-plugin-lightslider
Grav LightSlider Plugin
Stars: ✭ 14 (+16.67%)
Mutual labels:  grav, grav-plugin
grav-plugin-simplesearch
Grav SimpleSearch Plugin
Stars: ✭ 40 (+233.33%)
Mutual labels:  grav, grav-plugin

Grav Maintenance Plugin

GPM Installation

If you ever need to take your site offline temporarily or during development, you can use the Grav maintenance plugin to easily accomplish it..

This plugin works in concert with the login plugin which is required if you wish to have the ability to login while the site is in maintenance mode.

Installation

Installing the Maintenance plugin can be done in one of two ways. Our GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.

GPM Installation (Preferred)

The simplest way to install this plugin is via the Grav Package Manager (GPM) through your system's Terminal (also called the command line). From the root of your Grav install type:

bin/gpm install maintenance

This will install the Maintenance plugin into your /user/plugins directory within Grav. Its files can be found under /your/site/grav/user/plugins/maintenance.

Manual Installation

To install this plugin, just download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to maintenance. You can find these files either on GitHub or via GetGrav.org.

You should now have all the plugin files under

/your/site/grav/user/plugins/maintenance

NOTE: This plugin is a modular component for Grav which requires Grav, the Problems plugin, and a theme to be installed in order to operate.

Usage

The default configuration provided in the user/plugins/maintenance.yaml file contains sensible defaults:

enabled: true
active: false
allow_login: true
login_access: 'site.login'
maintenance_page_route:

To make your own modifications to the configuration options, you should copy the user/plugins/maintenance/maintenance.yaml file into a file: user/config/plugins/maintenance.yaml. Then if you wish to modify a particular setting you should copy the whole node and modify it, for example:

active: true

Alternatively you can administrate the plugin via the Grav Admin plugin by clicking on plugins, and then on maintenance.

User Login Access

If you enable the allow_login option (default is enabled), Your offline maintenance page will consist of a message plus a login box to allow authorized users to authenticate. The default setting for the access is site.login.

This means that for a user to be able to login to the front end when in maintenance mode, you need to first create a user that has this access.

This can be achieved easily with the bin/grav newuser command. Just fill in appropriate values when prompted, and ensure you pick site access or admin and site access as this will provide the required site.login: true setting the user will need. Of course you can change the access to whatever you wish, so perhaps you want to have a specific site.maintenance access setting, you would need to manually add this to the list of user access in the user account YAML.

Usage

By default, the Maintenance plugin is enabled but is not active that means it's ready to go.

To switch into maintenance mode, simply toggle the active setting in plugin configuraiton.

Something you might want to do is to override the look and feel of the Maintenance page, and with Grav it is super easy.

Template

The plugin comes with a simple maintenance.html.twig file for rendering the offline page. This assumes your theme has a partials/base.html.twig. If your theme does not have this, or if you wish to modify the look and feel of the page, you can copy the template file templates/maintenance.html.twig from the plugin directory, into the templates folder of your custom theme. Make any modifications required.

/your/site/grav/user/themes/custom-theme/templates/maintenance.html.twig

You can now edit the override and tweak it however you prefer.

Page

The plugin also comes with a simple page file located in pages/maintenance.md. If you wish to customize the content of this page, you can simply copy it into a new folder in your pages folder of your Grav user directory and modify it as required.

/your/site/grav/user/pages/maintenance/maintenance.md

After this you need to tell the plugin where to look for this custom page, and this can be done by setting the maintenance_page_route setting in the plugin configuration.

Note: This should be a valid Grav route, for example: `/system/maintenance'

Updating

As development for the Maintenance plugin continues, new versions may become available that add additional features and functionality, improve compatibility with newer Grav releases, and generally provide a better user experience. Updating Maintenance is easy, and can be done through Grav's GPM system, as well as manually.

GPM Update (Preferred)

The simplest way to update this plugin is via the Grav Package Manager (GPM). You can do this with this by navigating to the root directory of your Grav install using your system's Terminal (also called command line) and typing the following:

bin/gpm update maintenance

This command will check your Grav install to see if your Maintenance plugin is due for an update. If a newer release is found, you will be asked whether or not you wish to update. To continue, type y and hit enter. The plugin will automatically update and clear Grav's cache.

Note: Any changes you have made to any of the files listed under this directory will also be removed and replaced by the new set. Any files located elsewhere (for example a YAML settings file placed in user/config/plugins) will remain intact.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].