diff --git a/pages/01.blog/more-privacy-for-your-browser-firefox-librewolf-tor-iceraven-and-pale-moon/item.en.md b/pages/01.blog/more-privacy-for-your-browser-firefox-librewolf-tor-iceraven-and-pale-moon/item.en.md index 6506a4d..87a6db6 100644 --- a/pages/01.blog/more-privacy-for-your-browser-firefox-librewolf-tor-iceraven-and-pale-moon/item.en.md +++ b/pages/01.blog/more-privacy-for-your-browser-firefox-librewolf-tor-iceraven-and-pale-moon/item.en.md @@ -17,6 +17,9 @@ taxonomy: aura: author: dan media_order: private_browisng.png +permissions: + authors: + - 'Daniel Sundermann' --- # Browser diff --git a/plugins/auto-author/.gitignore b/plugins/auto-author/.gitignore new file mode 100644 index 0000000..47ce0f1 --- /dev/null +++ b/plugins/auto-author/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +.idea +vendor +composer.phar +composer.lock +phpunit.xml \ No newline at end of file diff --git a/plugins/auto-author/CHANGELOG.md b/plugins/auto-author/CHANGELOG.md new file mode 100644 index 0000000..4b20062 --- /dev/null +++ b/plugins/auto-author/CHANGELOG.md @@ -0,0 +1,5 @@ +# v0.1.0 +## 09/03/2017 + +1. [](#new) + * ChangeLog started... diff --git a/plugins/auto-author/LICENSE b/plugins/auto-author/LICENSE new file mode 100644 index 0000000..4b7be87 --- /dev/null +++ b/plugins/auto-author/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Sven Sanzenbacher + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/plugins/auto-author/README.md b/plugins/auto-author/README.md new file mode 100644 index 0000000..73bc17f --- /dev/null +++ b/plugins/auto-author/README.md @@ -0,0 +1,62 @@ +# Auto Author Plugin + +The **Auto Author** Plugin is for [Grav CMS](http://github.com/getgrav/grav). Automatically adds an author to frontmatter when creating a new page via Grav Admin plugin. + +## Usage + +Whenever you create a new page via the admin plugin, an author will be automatically inserted in the frontmatter of the page. The author name is dependent on the configuration. It can be the author name from `site.yaml` or the fullname of the current admin user. + +``` +user/pages/02.my-new-page/default.md +--- +title: 'My new page' +author: 'Joe Bloggs' +--- +``` + +## Installation + +Installing the Auto Author plugin can be done in one of two ways. The 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)](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: + + bin/gpm install auto-author + +This will install the Auto Author plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your/site/grav/user/plugins/auto-author`. + +### 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 `auto-author`. You can find these files on [GitHub](https://github.com/-sven-sanzenbacher/grav-plugin-auto-author) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras). + +You should now have all the plugin files under + + /your/site/grav/user/plugins/auto-author + +> NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav) and the [Error](https://github.com/getgrav/grav-plugin-error) and [Problems](https://github.com/getgrav/grav-plugin-problems) to operate. + +## Configuration + +Before configuring this plugin, you should copy the `user/plugins/auto-author/auto-author.yaml` to `user/config/plugins/auto-author.yaml` and only edit that copy. + +Here is the default configuration and an explanation of available options: + +```yaml +# enables or disables the plugin +enabled: true +# true = use current admin user (fullname) or false = use site author name (default) +user: false +``` + +## License + +The MIT License (MIT) + +Copyright (c) 2015 Sven Sanzenbacher + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/plugins/auto-author/auto-author.php b/plugins/auto-author/auto-author.php new file mode 100644 index 0000000..e751fe6 --- /dev/null +++ b/plugins/auto-author/auto-author.php @@ -0,0 +1,54 @@ + ['onAdminCreatePageFrontmatter', 0] + ]; + } + + /** + * Initialize the plugin + * + * @param Event $event + */ + public function onAdminCreatePageFrontmatter(Event $event) + { + $header = $event['header']; + if (!isset($header['author'])) { + if ($this->config->get('plugins.auto-author.user')) { + /** + * @var Admin $admin + */ + $admin = $this->grav['admin']; + $author = $admin->user->get('fullname'); + + } else { + $author = $this->grav['config']->get('site.author.name'); + } + $header['author'] = $author; + $event['header'] = $header; + } + } +} diff --git a/plugins/auto-author/auto-author.yaml b/plugins/auto-author/auto-author.yaml new file mode 100644 index 0000000..1eaead7 --- /dev/null +++ b/plugins/auto-author/auto-author.yaml @@ -0,0 +1,2 @@ +enabled: true +user: false diff --git a/plugins/auto-author/blueprints.yaml b/plugins/auto-author/blueprints.yaml new file mode 100644 index 0000000..34aff83 --- /dev/null +++ b/plugins/auto-author/blueprints.yaml @@ -0,0 +1,39 @@ +name: Auto Author +version: 0.1.0 +description: Automatically adds an author to frontmatter when creating a new page via Grav Admin plugin +icon: user-circle +author: + name: Sven Sanzenbacher +homepage: https://github.com/naucon/grav-plugin-auto-author +keywords: grav, plugin, auto-author, author, autor, frontmatter +bugs: https://github.com/naucon/grav-plugin-auto-author/issues +docs: https://github.com/naucon/grav-plugin-auto-author/blob/develop/README.md +license: MIT + +dependencies: + - { name: admin, version: '>=1.2.3' } + +form: + validation: strict + fields: + enabled: + type: toggle + label: Plugin status + highlight: 1 + default: 0 + options: + 1: Enabled + 0: Disabled + validate: + type: bool + user: + type: toggle + label: Current user + highlight: 1 + default: 0 + options: + 1: Enabled + 0: Disabled + validate: + type: bool + help: use current admin user (fullname) or site author