Grav plugins

Grav plugins DEFAULT

Plugin Tutorial

Plugins are usually developed because there is a task that can not be completed with Grav's core functionality.

In this tutorial, we will create a plugin that helps Grav to deliver a random page to the user. You have probably seen similar functionality on blog sites as a way to provide a random blog-post when you click a button.

Because there is already a plugin that performs this job named , we'll call this test plugin .

This feature is not possible out-of-the-box, but is easily provided via a plugin. As is the case with a great many aspects of Grav, there is no one-way to do this. Instead, you have many options. We will cover just one approach...

Randomizer Plugin Overview

For our plugin we will take the following approach:

  1. Activate the plugin if a URI matches our configured 'trigger route'. (e.g. )

  2. Create a filter so that only configured taxonomies are in the pool of random pages. (e.g. )

  3. Find a random page from our filtered pool, and tell Grav to use it for the page content.

OK! This sounds simple enough, right? So, let us get cracking!

Step 1 - Install DevTools plugin

Previous versions of this tutorial required creating a plugin manually. This whole process can be skipped thanks to our new DevTools Plugin

The first step in creating a new plugin is to install the DevTools Plugin. This can be done in two ways.

Install via CLI GPM

  • Navigate in the command line to the root of your Grav installation

Install via Admin plugin

  • After logging in, simply navigate to the Plugins section from the sidebar.
  • Click the Add button in the top right.
  • Find DevTools in the list and click the Install button.

Step 2 - Create Randomizer plugin

For this next step you really do need to be in the command line as the DevTools provide a couple of CLI commands to make the process of creating a new plugin much easier!

From the root of your Grav installation enter the following command:

This process will ask you a few questions that are required to create the new plugin:

At this point you need to run in the newly created plugin folder.

The DevTools command tells you where this new plugin was created. This created plugin is fully functional but will not automatically have the logic to perform the function we wish. We will have to modify it to suit our needs.

Step 3 - Plugin basics

Now we've created a new plugin that can be modified and developed. Let's break it down and have a look at what makes up a plugin. If you look in the folder you will see:

This is a sample structure but some things are required:

Required items to function

These items are critical and your plugin will not function reliably unless you include these in your plugin.

  • - The configuration file used by Grav to get information on your plugin. It can also define a form that the admin can display when viewing the plugin details. This form will let you save settings for the plugin. This file is documented in the Forms chapter.
  • - This file will be named according to your plugin, but can be used to house any logic your plugin needs. You can use any plugin event hook to perform logic at pretty much any point in Grav's lifecycle.
  • - This is the configuration used by the plugin to set options the plugin might use. This should be named in the same way as the file.

Required items for release

These items are required if you wish to release your plugin via GPM.

  • - A file that follows the Grav Changelog Format to show changes in releases.
  • - a license file, should probably be MIT unless you have a specific need for something else.
  • - A 'Readme' that should contain any documentation for the plugin. How to install it, configure it, and use it.

Step 4 - Plugin configuration

As we described in the Plugin Overview, we need to have a few configuration options for our plugin, so the file should look something like this:

This allows us to have multiple filters if we wish, but for now, we just want all content with the taxonomy to be eligible for the random selection.

All plugins must have the option. If this is in the site-wide configuration, your plugin will never be initialized by Grav. All plugins also have the option. If this is in the site-wide configuration, each page will need to activate your plugin. Note that multiple plugins also support / in page frontmatter by using , detailed below.

The Grav default install has taxonomy defined for and by default. This configuration can be modified in your file.

Of course, as with all other configurations in Grav, it is advised not to touch this default configuration for day-to-day control. Rather, you should create an override in a file called to house any custom settings. This plugin-provided is really intended to set some sensible defaults for your plugin.

Step 5 - Base plugin structure

The base plugin class structure will already look something like this:

We need to add a few statements because we are going to use these classes in our plugin, and it saves space and makes the code more readable if we don't have to put the full namespace for each class inline.

Modify the statements to look like this:

The two key parts of this class structure are:

  1. Plugins need to have at the top of the PHP file.
  2. Plugins should be named in titlecase based on the name of the plugin with the string appended to the end, and should extend , hence the class name .

Step 6 - Subscribed events

Grav uses a sophisticated event system, and to ensure optimal performance, all plugins are inspected by Grav to determine which events the plugin is subscribed to.

In this plugin we are going to tell Grav we're subscribing to the event. This way we can use that event (which is the first event available to plugins) to determine if we should subscribe to other events.

Note: The first event listener is only needed in Grav 1.6. Grav 1.7 automatically calls the method.

Step 7 - Determine if the plugin should run

The next step is to add a method to our class to handle the event so it only activates when a user tries to go to the route we have configured in our file. Replace the current 'sample' plugin logic with the following:

First, we get the Uri object from the Dependency Injection Container. This contains all the information about the current URI, including the route information.

The config() method is already part of the base Plugin, so we can simply use it to get the configuration value for our configured .

Next, we compare the configured route to the current URI path. If they are equal, we instruct the dispatcher that our plugin will also listen to a new event: .

By using this approach, we ensure we do not run through any extra code if we do not need to. Practices like these will ensure your site runs as fast as possible.

Step 8 - Display the random page

The last step of our plugin is to display the random page, and we can do that by adding the following method:

This method is a bit more complicated, so we'll go over what's going on:

  1. First, we get the Taxonomy object from the Grav DI Container and assign it to a variable .

  2. Then we retrieve the array of filters from our plugin configuration. In our configuration this is an array with 1 item: ['category' => 'blog'].

  3. Check to ensure we have filters, then create a new in the variable to store our pages.

  4. Append all pages that match the filter to our variable.

  5. Unset the current object that Grav knows about.

  6. Set the current to a random item in the collection.

Step 9 - Cleanup

The example plugin that was created with the DevTools plugin, used an event called . This event is not used in our new plugin, so we can safely remove the entire function.

Step 10 - Final plugin class

And that is all there is to it! The plugin is now complete. Your complete plugin class should look something like this:

If you followed along, you should have a fully functional Randomizer plugin enabled for your site. Just point your browser to the , and you should see a random page. You can also download the original Random plugin directly from the Plugins Download section of the getgrav.org site.

Merging Plugin and Page Configuration

One popular technique that is used in a variety of plugins is the concept of merging the plugin configuration (either default or overridden user config) with page-level configuration. This means you can set site-wide configuration, and then have a specific configuration for a given page as needed. This provides a lot of power and flexibility for your plugin.

In recent versions of Grav, a helper method was added to perform this functionality automatically rather than you having to code that logic yourself. The SmartyPants plugin provides a good example of this functionality in action:

Implementing CLI in your Plugin

Plugins have also the capability of integrating with the command line to execute tasks. You can follow the plugin CLI documentation if you desire to implement such functionality.

Found errors? Think you can improve this documentation? Simply click the Edit link at the top of the page, and then the icon on Github to make your changes.

Sours: https://learn.getgrav.org/16/plugins/plugin-tutorial

7 Best Grav Plugins to Enhance Your Website

3 Aug 2020 •Grav CMS

Looking for the best Grav plugins for your website or blog? In this post we’ll cover off the top seven most useful plugins for all Grav site owners. This is more than just a list of cool or interesting plugins. Read on to see how each plugin can benefit you directly, whether it be making your life easier as a site administrator, improving SEO, enhancing user experience or providing social proof for your service or product.

1. Admin Panel

Being a flat-file CMS, Grav can be administered perfectly well from the command line and IDE. But the Grav Admin Panel plugin makes managing your site even easier, providing a web based GUI with all of the features you would expect of a modern CMS. Some of these features include:

  • Secure user login and user management including password reset via email
  • Single-click installation of plugins, themes and updates
  • Create, edit, move, copy and delete pages
  • Drag and drop media uploads
  • Syntax highlighting code editor with instant preview
  • Backup manager

Grav admin dashboard

Giving you the flexibility to achieve all of the above from a cafe via your smartphone, the Admin Panel plugin is a must-have for any Grav administrator.

2. Sitemap

Providing an XML sitemap is an essential technical SEO best practice, and the first step in making sure your pages appear in search results. Automatically generating such a list is made incredibly easy with the Sitemap plugin for Grav. Simply installing the plugin makes a sitemap.xml file available, listing all the pages in your site. Configuration options can then be tweaked to adjust update frequency and priority and to add or remove select pages from the list.

3. Aura

Continuing with the technical SEO theme, the Grav Aura plugin allows you to automatically generate structured data for each of your pages, providing search engines with information about your company, your website and the page content in the most efficient way possible.

As well as this, Aura will automatically generate the metadata called upon by social platforms such as LinkedIn, Twitter and Facebook when sharing links to your site. This gives you full control over the preview image, title and description that will appear in social posts linking back to your website. To enhance search and social presence for your site, you need look no further than Aura.

4. SimpleSearch

When building out your site you hopefully put some thought towards site structure and navigation, in an effort to allow your users to easily find the information they’re after. No matter how well you have achieved this goal however, sometimes the fastest way to get what you need is via an on-site search. This is particularly important for larger sites where there is no way every page can be represented in the navigation menu, and some pages may take three or more clicks to get to, even when you know where they are.

As the name implies, the SimpleSearch plugin adds a basic search functionality to your Grav site. Look a little deeper though and you’ll see this plugin is highly configurable, allowing you to create multiple searches, limiting which areas of your site are included in each and also which information to search within a page, such as title, content, taxonomy and header.

It comes with templates for both search input and results page that you can drop straight into your page or theme. Alternatively you can copy these and edit them allowing you full control over style and functionality. For any site with more than a few pages, this is an essential plugin to enhance your user experience.

Grav plugin SimpleSearch results page example

5. Related Pages

Speaking of user experience, there are many reasons why it is in your interest to ensure users enjoy their stay on your site. If a user lands on your site via a Google search then hits the back button 5 seconds later, that is a strong indicator that they did not enjoy their stay on your site. The best thing you can do to combat this is provide fit-for-purpose content on the initial landing page. The next best thing you can do is provide links to even more fit-for-purpose content to entice users to keep interacting with your site.

The Related Pages plugin for Grav can calculate which pages relate to other pages on your site using a highly configurable set of options to determine a score for each page you set it to look at and compare. The plugin will then provide a list of pages which you can include in your page or theme, giving users several options to go on with once they’re done with the initial landing page. This is especially useful for blogs where you may have several articles around a central topic the reader is researching.

6. Aura Authors

Including a blog section on your site can be an excellent vehicle to deliver fresh content on a regular basis. In doing so you may find you want to include some details about each article’s author, such as an image, bio/description and social media links.

Grav Plugin Aura Authors example

The Aura Authors plugin for Grav gives you a means to build up a central repository of author information for your site, then simply set the author for each article from a drop-down list. By saving author information in a single place, any edits made there will be automatically reflected across each article belonging to that author.

On top of this, the Aura Authors plugin integrates with the original Aura plugin to output author information in both structured data and metadata for enriched search results and social shares.

7. JSComments

Another way to encourage user interactivity with your site is to provide a comments section. It can also be a great way to build a sense of community for your readers and hopefully gain some social proof for your product or service at the same time.

The JSComments plugin for Grav integrates comments from external applications Discourse, Disqus or Facebook (to name but a few). This method allows you to combine the simplicity and speed of a flat-file CMS with the power of a number of fully featured social platforms. If you’re keen to start a dialogue on your site, the JSComments plugin is a must.

The Right Tools for the Job

And there you have it. The best Grav plugins to streamline site admin, improve SEO, enhance user experience and provide social proof in one handy list. If you are missing out on any of the above, now’s the time to get installing! Finally, if you have a specific requirement not covered by those listed, there are many more Grav plugins available on the official site.

Sours: https://www.theskylab.net/grav-cms/best-grav-plugins
  1. Ismaili india
  2. Cerakote rings
  3. Cowtown trucking
  4. Ebay sirens
  5. Tesla screen cover

8 Must-Have Grav Plugins to Round Off Your Blog’s Installation

I recently switched my blog over from Blogger to Grav, and while quite a nifty platform on its own, Grav really shines once you prop it up with some custom themes and plugins.

This post will list the plugins I believe to be essential for a developer’s personal blog, and the reasons behind each suggestion.

Grav Logo

0. Admin

It goes without saying that every Grav installation should have the Admin panel installed. It’s a fantastic addon that makes the software much more usable, allows you to install plugins easily, lets you handle localization and translation, and much more.

The installation instructions for the Admin panel are in the official docs.

1. Google Analytics

Most themes have some kind of Google Analytics support baked-in, but some don’t, and some only have it on certain pages. If you’re not interested in extending a theme just to include a GA snippet in a template, the Google Analytics plugin is the right choice.

Once installed, a configuration option will appear in the plugins interface and allow for insertion of the UA key, which will then be injected into every page – regardless of whether or not the chosen theme supports it out of the box.

2. Archive Plus

The archive plus plugin helps produce an archive tree of posts sorted by month and year, much like the archive links on Blogger.

Archive plus in action

*Note: To use this one, an extended theme is necessary, but that’s very easy to accomplish. See the Bonus tweaks section at the end of this list.

Once installed, from the root of the installation, we copy the archive partial from the plugin’s folder into our custom theme (modify folder names as per your own custom theme’s name):

The archive plus partial can now be used in any other template as usual. For example, to include it in the home page of our custom Cacti theme, we copy the template from the theme to our custom theme’s folder, and add the partial inclusion into the block, like so:

Note that for things to show up, they need to have some taxonomy applied. For example, give them the tag “blog” and then in the plugin’s settings under Filters select , otherwise, nothing will show up.

Filtering taxonomies

Note: right now, the plugin doesn’t work well with multi-language sites in that it caches its archive tree once for the whole site, rather than per language. A fix is in progress.

3. External Links

The external links plugin adds a small “external link” icon to all links that lead away from the blog’s domain. Simple, and effective.

External links visible

Note: If you’re using a theme with the langswitcher functionality for multi-language support, like Cacti, the langswitcher partial forces a default class in the language links. The most effective solution (besides upvoting the issue requesting a customizable class) is to extend the langswitcher’s partial by copying it into a custom theme.

4. Reading Time

Medium-style indicator of estimated reading time for a given post is provided by the official reading time plugin.

Once installed, the plugin adds a new Twig filter which we can use on some text to turn it into a reading time label, like so:

This can then be placed anywhere in the post to show readers how much time they’ll have to set aside to read a post. Protip: it’s best to keep this under 10 minutes!

Note also that you can change the labels to those of your choice – useful when localizing.

Reading time in action

5. Sitemap

The Sitemap plugin automatically builds a search-engine friendly sitemap. This works equally well on multi-language sites, but requires the lang prefix before the sitemap route to actually render the language’s sitemap:

English sitemap

Croatian sitemap

With this plugin, your site is immediately ready for submission to search engines.

6. Highlight

Every developer needs code highlights in their blog posts, and the highlight plugin is what does the trick.

After installing it, to use it one needs to either manually edit the front-matter of a page (the stuff that goes before the content), or use expert mode in the Admin UI to edit it there, and include a highlight theme declaration. My example in the image below uses the Monokai theme:

Expert mode

When rendered, it looks like this:

Rendered code highlights

The following should be kept in mind:

  • to minimize performance impact, it’s best to only activate highlights per every page which needs it.

  • the plugin will try to autodetect the language it needs to render if no language hints are provided, but it’s recommended to always provide them for both performance and accuracy:

7. Advanced Page Cache

While we’re on the topic of performance, the Advanced Page Cache Plugin caches pages in full based on their URLs and uses these static versions in future requests.

As the docs say, this means a manual cache bust is required when any changes are made, however, the performance improvements are rather dramatic and worth it. It’s important to keep the following in mind:

This plugin is intended for production scenarios where optimal performance is desired and more important than convenience. AdvancedPageCache is not intended to be used in a development environment or a rapidly changing one.

Many plugin events will not fire when a cached page is found becuase these are not processed by Grav, only the static page is returned. For example, because there is no RenderEvent with the cached page, the DebugBar will not show even if enabled.

Also keep in mind that the plugin doesn’t really work as well as it should with multi-language sites, so it’s best to use it only in production and only on single-language sites. For powerful multi-language site caching, look into a front layer like Varnish.

8. Diagrams

As a developer, you might sometimes need to draw diagrams in your explanations of the code you’re presenting. The diagrams plugin helps with that.

This plugin allows you to define diagrams within the Markdown content of your post(s), thus bypassing the need to any sort of illustration software, and keeping the style consistent across all your writings. Here are examples of two diagrams produced with the plugin – for actual usage, please see the plugin’s README file.

Bonus Tweaks and Tips

Here are some bonus tweaks you should apply to your Grav installation.

Clear Cache

When ever something new is installed, remember to clear the cache (from the Dashboard) to apply changes.

Grav's clear cache button

Translating Strings

In the case of, for example, the reading plugin above, you might want to prefix the time with a “Reading time:” label. However, this can get awkward when using a theme with multi-language functionality built in, like the Cacti theme I’m using.

To help with this, each multi-language supporting theme has a file in its root folder. Here’s an example from my own modified Cacti language file:

The values that aren’t defined in the secondary language (and others) default back to those from the primary one. Notice the label . To use it in a template, we do this:

The filter to which we’re piping the string is a translate filter which looks at the file of the theme and pulls the value from there:

Reading time verbose

In case of arrays, like with dates above, the filter comes in handy:

The above snippet means “send the array to the (translateArray) filter, and translate its X element, where X is “.

Extended Theme

Extending a theme is relatively easy, and should be done to allow for inclusion of custom partials and edited templates without breaking the parent theme. This also allows us to update the theme via the official channels. To extend a theme (the example uses the Cacti theme):

  • Create a new folder in . E.g. .

  • Create a new YAML file: :

    Remember to include any additional values into this same file that already exist in the default , otherwise, some theme functionality might be missing:

  • Create a file:

  • Modify the value under in to be .

That’s it. The extended theme will be read first, and anything missing will be pulled from the base theme. For more advanced theme extension procedures, this post will come in handy.

Conclusion

Grav is a relatively new, highly performant, and very intuitive flat-file CMS which, while not being very anal on security, is highly dedicated to simplicity and usability.

In a future post, I’ll cover some advanced plugins for implementing comments, image auto-optimization, CDNs, and much more.

I’ll also talk more about why I picked Grav in a later post, but for now I’d like to know what you are using for a personal blogging engine (Static site generators? Full blown CMS?), and whether or not you’d like to recommend some Grav plugins I missed.

Let us know!

Sours: https://www.sitepoint.com/8-must-have-grav-plugins-to-round-off-your-blogs-installation/
Pt 4. Grav CMS Guide for Absolute Beginners - How to Install Plugins


We have collection of more than 1 Million open source products ranging from Enterprise product to small libraries in all platforms. We aggregate information from all open source repositories. Search and find the best for your needs. Check out projects section.



Displaying 1 to 20 from 55 results


grav-plugin-advanced-pagecache - Grav AdvancedPageCache Plugin


AdvancedPageCache is a powerful static page cache type plugin that caches the entire page output to the Grav cache and reuses this when the URL path is requested again. This can dramatically increase the performance of a Grav site. Due to the static nature of this cache, if enabled, you will need to manually clear the cache if you make any page modifications. This cache plugin (by default) will cache pages that have URLs that contain either querystring or grav-paramater style values, you may want to disable this behavior. This plugin can provide dramatic performance boosts and is an ideal solution for sites with many pages and predominantely static content.

grav grav-plugin cache performance caching



grav-plugin-anchors - Grav Anchors Plugin


anchors is a Grav plugin that provides automatic header anchors via the anchorjs Vanilla JS plugin. If for some reason you can't use GPM you can manually install this plugin. Download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to anchors.

grav grav-plugin anchors anchor

grav-plugin-archives - Grav Archives Plugin


Archives is a Grav plugin that automatically appends a month_year taxonomy to all pages. It then provides a partials\archives.html.twig template which you can include in a blog sidebar, that then is able to create links that will display pages from that month/year. This is a very handy feature to have for blogs. Installing the Archives 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.

grav grav-plugin archives archive taxonomy

grav-plugin-assets - Grav Assets Plugin


assets is a Grav plugin that provides a convenient way to add CSS and JS assets directly from your pages. Installing the Assets 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.

grav grav-plugin assets assets-management

grav-plugin-auto-date - Grav Auto Date Plugin


The Auto Date Plugin is designed for Grav CMS and automatically adds the current date to frontmatter when createing a new page via the Admin plugin. There's not much to this plugin, simply install it and whenever you create a new page via the admin plugin, the current date will be inserted in the frontmatter of the page and show up in the Options -> Publishing Tab. The format of the date is dependent upon the value set in system.yaml under pages: dateformat: default and if not set will use H:i d-m-Y as the date format.

grav grav-plugin date dates grav-admin

grav-plugin-bootstrapper - Grav Bootstrapper Plugin


bootstrapper is a Grav plugin that can be used as a dependency for other themes and plugins to load Bootstrap Framework assets. The main purpose of this plugins is to allow the Boostrap theme to depend on the bootstrap CSS/JS and allow the plugin to be updated independently of the theme itself. If for some reason you can't use GPM you can manually install this plugin. Download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to bootstrapper.

grav grav-plugin bootstrap

grav-plugin-breadcrumbs - Grav Breadcrumbs Plugin


Breadcrumbs is a Grav plugin that adds links to the previous pages (following the hierarchical structure). It is particularly useful if you are using Grav to run a blog. Installing the Breadcrumbs 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.

grav grav-plugin breadcrumbs

grav-plugin-cdn - Grav CDN Plugin


This is a simple Grav plugin that takes provides a simple way to integrate a Pull Zone CDN service (such as MaxCDN) with minimal fuss. Installing the CDN 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.

grav grav-plugin cdn content-delivery optimization speed

grav-plugin-data-manager - Grav Data Manager Plugin


The Data Manager Plugin for Grav adds the ability to visualize data. This is particularly useful for the admin and form plugins. Additional plugins may store data content, and the Data plugin - properly configured - is able to show their data too. | IMPORTANT!!! This plugin is currently in development as is to be considered a beta release. As such, use this in a production environment at your own risk!. More features will be added in the future.

grav grav-plugin data data-visualization

grav-plugin-devtools - Grav Devtools Plugin


The devtools is a Grav Plugin that lets you quickly create a scaffolding for your new plugins and themes. The plugin provides CLI commands that allow for the quick and easy deployment of a sample scaffolding for your new plugin. If for some reason you can't use GPM you can manually install this plugin. Download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to devtools.

grav grav-plugin devtools developer-tools

grav-plugin-readingtime - Grav ReadingTime Plugin


ReadingTime is a Grav plugin which allows Grav to display the reading time of a page's content. This is especially useful for blogs and other sites as it gives the reader a quick idea of how much time they will need to set aside to read the page in full. Enabling the plugin is very simple. Just install the plugin folder to /user/plugins/ in your Grav install. By default, the plugin is enabled.

grav grav-plugin readingtime

grav-plugin-relatedpages - Grav RelatedPages Plugin


Related Pages is a Grav plugin that calculates related pages for the current page. It uses a highly configurable set of options to determine a score for each page you configure it to look at and compare. Installing the Related Pages 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.

grav grav-plugin

grav-plugin-shortcode-core - Grav Shortcode Core Plugin


The Shortcode Core plugin allow for the development of simple yet powerful shortcode plugins that utilize the common format utilized by WordPress and BBCode. The core plugin loads the libraries required and fires a new event that other plugins can use. It also provides a mechanism for adding CSS/JS assets that are cached so that shortcodes can work effectively even when the processed page content is cached. This ensures that shortcodes are only processed once and will not impact performance by doing unnecessary work on every page. This plugin uses the Thunderer Advanced shortcode engine. For more information please check out that repo on GitHub.

grav grav-plugin shortcode shortcodes shortcode-engine
Sours: https://www.findbestopensource.com/tagged/grav-plugin

Plugins grav

    The admin plugin provides an easy-to-use web-based user interface to configure and operate Grav on a daily basis. It's packed full of great features and functionality but still sticks to Grav's principals of keeping things simple, fast, and extensible. Check out the Admin Documentation for more detailed information.

    Search Grav Pages in Frontend via JavaScript. Search based on JQuery. Useful for static websites without PHP support.

    The Next Generation Content Editor for Grav. A true WYSIWYM Editor with markdown, shortcode, twig, and plugin capabilities.

    Automatically adds or modifies the date, date_modified, author, editor and revision to frontmatter when a page is saved via the Grav Admin Plugin.

    TecArt cookie banner manager provides a cookie banner plugin with complete cookie management in admin and extended frontend views. The plugin is based on the popular CookieConsent JS-library by Osano.

    Add to grav LRS connectivity and basic page activity statements tracking. Turns your favorite grav app into an simple Learning Management System.

    Ability add custom HTTP Headers for Content Security Policy (CSP), Cross Origin Resource Sharing (CORS), Referrer-Policy, Permissions Policy, and other security needs

    Warms the cache by hitting all the pages in the sitemap

    Generate responsive versions of images as they are uploaded, and add sizes directives per CSS class.

    The Feed plugin is a simple yet powerful add-on that lets you view a Grav Collection as JSON, RSS or Atom news feed.

    YouTube is a simple plugin that converts markdown links or shortcodes into responsive embeds.

    The Responsive Images plugin makes websites faster by auto-generating attributes for foreground images and CSS media queries for background images.

    Allows to synchronize portions of Grav with Git Repositories (GitHub, BitBucket, GitLab)

    This plugin provides code highlighting functionality via the Prism.js syntax highlighter with lots of themes and plugins.

    A lightweight but flexible lightbox implementation for Grav that supports galleries

    Don't be fooled, the SimpleSearch plugin provides a fast and highly configurable way to search your content.

    Automatically add meta tags and structured data to your pages for visually appealing and informative search results and social media sharing.

    Page Inject is a powerful plugin that lets you inject entire pages or page content into other pages using simple markdown syntax

    Widget is a plugin that lets you embed reusable modular components into pages using a simple header configuration

    Enables substitution of typographic characters during Markdown processing

    Provide automatically generated XML sitemaps with this very useful, but simple to configure, Grav plugin.

    Password protection is a simple plugin which allows you to specify a uniqe password for a page. Every page can have a different password.

    This grav plugin displays a "Back to Top" link at the end of every section, so the reader can jump back up to the table of contents. The plugin integrates the js lib "Return to Top Arrow" by rdallaire.

    This plugin adds small icons to external and mailto links, informing users the link will take them to a new site or open their email client.

    A highly sophisticated and configurable plugin that calculates related pages in relation to the current page.

    Generates a special RSS feed with blog pages, in accordance with the Yandex.Turbo technology.

    Turns the title-attribute in img-elements into figure-elements with a figcaption.

    A standard form inside a tingle modal popup. Click on a button (created with a shortcode) and the form pops up.

    Short codes to embed a map and markers using Leaflet, Extra-markers and OpenStreetMap (optionally other providers)

    Plugin to select, update and insert into an sqlite3 database

    Plugin to integrate Zapier with Grav via customized RSS feeds

    Securely integrate Instagram right into your site and display basic profile information, photos and videos. Thanks to the new and secure Instagram Basic Display API, your privacy will be safe.

    The Breadcrumbs plugin provides a simple method to display the depth of your content/navigation structure.

    With the TaxonomyList plugin you can easily create list of taxonomy items such as tags, categories, etc.

    Looks for images with defined title attribute and converts them to fig-captions.

    Allows for Grav user authentication against an LDAP Server such as OpenLDAP or ActiveDirectory

    Simple cookie plugin is based on the popular CookieConsent JS-library. For Advanced Opt-In/Opt-Out configurations you can use the 'Custom configuration' option.

    Embeds social status (like tweets, instagram posts, toots, etc.) in articles without using their embed iframe, but rather statically without any dependency to the service.

    The Events plugin provides events for a Grav site using event frontmatter.

Sours: https://getgrav.org/downloads/plugins
GRAV CMS ve Admin Plugin Kurulumu

Grav SimpleSearch Plugin

SimpleSearch

is a simple, yet very powerful Grav plugin that adds search capabilities to your Grav instance. By default it can search Page Titles, Content, Taxonomy, and also a raw page Header.

Installing the SimpleSearch 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:

This will install the SimpleSearch plugin into your directory within Grav. Its files can be found under .

Manual Installation

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

You should now have all the plugin files under

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

To effectively use the plugin, you first need to create an override config. To do so, create the folder (if it doesn't exist already) and copy the simplesearch.yaml config file in there.

By creating the configuration file: you have effectively created a site-wide configuration for SimpleSearch. However, you may want to have multiple searches.

NOTE: If you want to search ALL PAGES just keep the section empty.

To accomplish multiple search types in a single site, you should use page-based configuration. This is simple to do, simply provide any or all of the configuration options under a header in your page frontmatter. For example:

These page headers will only be taken into account if the search route points to this page. For example: here the route points to which in turn resolves to . You can also specify the route explicitly with if you so choose. This header is within the file. We will cover this self-controlled form of search handling below.

There are two approaches to using SimpleSearch.

1. Standalone Search Page

This is the traditional approach and involves having a searchbox 'somewhere' on your site. When you search you are shown a new page that displays the search results. On this page you will see a summary of the results and be able to click a link to visit each applicable page within your site. Think about how Google and other traditional search engines work.

After installing the SimpleSearch plugin, you can add a simple searchbox to your site by including the provided twig template. Or copy it from the plugin to your theme and customize it as you please:

By default the simplesearch_searchbox Twig template uses the as defined in the configuration. The SimpleSearch plugin uses this route and then appends a parameter to create the following final URL.

  1. : This is the route setting and it can be changed
  2. : This is the query itself, where is what you are searching for.

The plugin actively looks for URLs requested that match the configured and if so it intercepts the call and renders the results template as specified by the configuration options, (defaults to as provided by the plugin).

With this approach, the filters control which pages are searched. You can have multiple taxonomy filters here, and can configure the combinator to require any match (via ) or require all conditions to match (via ).

You can also completely customize the look and feel of the results by overriding the template. There are two methods to do this.

  1. Copy the file templates/simplesearch_results.html.twig under your theme templates and customize it.

  2. Create your very own results output. For this you need to change the reference in the config (let's say mysearch_results). In your theme you would then create the new template under and write your customizations. This is how it looks by default:

2. Self-Controlled Search Page

This is a new feature of SimpleSearch and it's a very useful and simple way to provide a 'filter' like search of a collection listing page. In this example, we will assume you have a Blog listing page you wish to be able to search and filter based on a search box.

To accomplish this, you need to use the page-based configuration as described above, and configure multiple filters, to use the page's content collection: http://learn.getgrav.org/content/headers#collection-headers

This will mean the search will only search pages that this page already is using for the collection. The Items could be anything the page collections support:

For further help with the and settings, please refer to our Taxonomy and Headers documentation.

Multiple filters can be provided, and in order to search in the page's Tag field you would add as shown in the configuration example above.

The only thing needed to provide this functionality is a search box that points to the current page and appends the parameter. You can again simple include the sample file or add your own. Because the route is configured to point to the blog page, and because the blog page already iterates over a collection, SimpleSearch will replace the page collection with the search-filtered collection. No results page is required.

Performance

Simplesearch is not a full-fledged index-powered search engine. It merely iterates over the pages and searches the content and title for matching strings. That's it. This is not going to result in screaming fast searches if your site has lots of content. One way to optimize things a little is to change the configuration option from to . This means the method is used rather than the method, to retrieve the page content, and in turn means plugin events, markdown processing, image processing, and other time-consuming tasks are not performed. This can often yield adequate search results without the need for all this extra work.

Searching Taxonomy

By default SimpleSearch will search in the Title, Content, and Taxonomy. All taxonomy will be searched unless you provide a taxonomy filter either in the page, or in the global plugin configuration:

This will ensure that only tag taxonomy types will be searched for the query.

Will ensure that both tag and author taxonomy types are searched.

As all taxonomy types are searched by default, in order to stop searching into taxonomies completely simply set the filter to false:

Ignoring a page

A page can be setup to "opt-out" of being included in the search results by setting the following in page frontmatter:

simplesearch: process: false

Ignoring accented characters

You can tell Simplesearch to return a positive value when searching for characters that have an accent. So for example will be both equivalent to .

To do so, enable Ignore accented characters in Admin, or manually set to true in the plugin configuration. The locale must be installed on the server.

As development for SimpleSearch 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 SimpleSearch 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:

This command will check your Grav install to see if your SimpleSearch 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 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 ) will remain intact.

Sours: https://github.com/getgrav/grav-plugin-simplesearch

Similar news:

Grav Related Pages Plugin

is a Grav plugin that calculates related pages for the current page. It uses a highly configurable set of options to determine a score for each page you configure it to look at and compare.

It has 4 main calculation options that may be combined to produce very accurate results:

  • Explicit page references in the header of a given page
  • Taxonomy to Taxonomy matching. i.e. comparing the number of matching tags in other pages
  • Taxonomy to Content matching. i.e counting the number of times a tag is in other page content
  • Content to Content matching. A comparison of the content between current and other pages (caution)

You can configure which combination of methods to use, customize the scoring, adjust how many related pages to show, cut-off scores and more!

Related Pages

Installing the Related Pages 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:

This will install the Related Pages plugin into your directory within Grav. Its files can be found under .

Manual Installation

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

You should now have all the plugin files under

The default configuration provided in the file contains sensible defaults:

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

To use the explicit page match functionality, simply add a array with slugs to the posts you wish to be related:

This should be used if you wish to match a taxonomy (for example ) to other pages. The more tags that match, the higher the score. For example if your current page has , and another page had , there would be 3 matches, and according to the default scores, that would mean a match score of . You can of course configure the scoring to best suite your site.

This methodology takes the current pages taxonomy (for example ), and counts the number of times these items are mentioned in the content of other pages. The higher the number of matches to tags, the higher the score.

Content Matching uses a string comparison function to calculate the overall similarity of the current page to the other pages in the collection. A score of means the content matches 100%, while a lower number means less similarity. This is a very powerful mechanism, but because of the amount of work being done, and with a large amount of articles, this could cause a bit of a slowdown before the values are cached.

When all the enabled methodologies have been processed, a unique list in order of score (highest first) is created. This array of page 'paths' is stored as a Twig variable that can be accessed in your Twig templates of your theme.

To display a list of related pages, you need to reference the provided or provide your own modified version in your theme, and reference that. For example:

This will ensure that the plugin is installed and enabled, and also that there are some related pages before including the template to render them.

This plugin processes during the event. It first checks cache to see if this page has been processed before, and if not, it runs through the configured options to build the list of related pages.

All of this is pretty fast except for which performs a full comparison using the content of the current page and comparing it with every other page in the configured collection. If you have lots of pages, this could get quite slow.

This work is only performed the first time after a clear-cache event, after that it is cached for subsequent requests. If you have the debugger enabled, you can see the state of cache hits and cache missses in the messages tab.

Sours: https://github.com/getgrav/grav-plugin-relatedpages


537 538 539 540 541