Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 5.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Grav Error Plugin
  2. ![GPM Installation](assets/readme_1.png)
  3. `error` is a [Grav](http://github.com/getgrav/grav) Plugin and allows to redirect errors to nice output pages.
  4. This plugin is included in any package distributed that contains Grav. If you decide to clone Grav from GitHub you will most likely want to install this.
  5. # Installation
  6. Installing the Error 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.
  7. ## GPM Installation (Preferred)
  8. The simplest way to install this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's Terminal (also called the command line). From the root of your Grav install type:
  9. bin/gpm install error
  10. This will install the Error plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your/site/grav/user/plugins/error`.
  11. ## Manual Installation
  12. 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 `error`. You can find these files either on [GitHub](https://github.com/getgrav/grav-plugin-error) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras).
  13. You should now have all the plugin files under
  14. /your/site/grav/user/plugins/error
  15. >> NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav), the [Problems](https://github.com/getgrav/grav-plugin-problems) plugin, and a theme to be installed in order to operate.
  16. # Usage
  17. The `error` plugin doesn't require any configuration. The moment you install it, it is ready to use.
  18. Something you might want to do is to override the look and feel of the error page, and with Grav it is super easy.
  19. ### Template
  20. Copy the template file [error.html.twig](templates/error.html.twig) into the `templates` folder of your custom theme and that is it.
  21. ```
  22. /your/site/grav/user/themes/custom-theme/templates/error.html.twig
  23. ```
  24. You can now edit the override and tweak it however you prefer.
  25. ### Page
  26. Copy the page file [error.md](pages/error.md) into the `pages` folder of your user directory and that is it.
  27. ```
  28. /your/site/grav/user/pages/error/error.md
  29. ```
  30. You can now edit the override and tweak it however you prefer.
  31. # Custom error pages
  32. The configuration allows to specify pages different than `/error` for specific error codes. By default, the `404` error leads to the `/error` page. If you change that, make sure the page you point to has a `error` template (which means, its markdown file is `error.md` or in the page frontmatter you specify `template: error`.
  33. # CLI Usage
  34. The `error` plugin comes with a CLI command that outputs the `grav.log` in a beautified way, with possibility of limiting the amount of errors displayed, as well as include the trace in the output.
  35. ### Commands
  36. | `bin/plugin error log` | |
  37. |------------------------|-----------------------------------------------------------------|
  38. | [ --limit N \| -l N ] | The amount of errors to display. Default is 5 |
  39. | [ --trace \| -t ] | When used, it will add the backtrace in the output of the error |
  40. # Updating
  41. As development for the Error 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 Error is easy, and can be done through Grav's GPM system, as well as manually.
  42. ## GPM Update (Preferred)
  43. The simplest way to update this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-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:
  44. bin/gpm update error
  45. This command will check your Grav install to see if your Error 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.
  46. ## Manual Update
  47. Manually updating Error is pretty simple. Here is what you will need to do to get this done:
  48. * Delete the `your/site/user/plugins/error` directory.
  49. * Download the new version of the Error plugin from either [GitHub](https://github.com/getgrav/grav-plugin-error) or [GetGrav.org](http://getgrav.org/downloads/plugins#extras).
  50. * Unzip the zip file in `your/site/user/plugins` and rename the resulting folder to `error`.
  51. * Clear the Grav cache. The simplest way to do this is by going to the root Grav directory in terminal and typing `bin/grav clear-cache`.
  52. > 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.