{"id":19692165,"url":"https://github.com/getgrav/grav-plugin-random","last_synced_at":"2025-04-29T09:31:22.484Z","repository":{"id":19318999,"uuid":"22557181","full_name":"getgrav/grav-plugin-random","owner":"getgrav","description":"Grav Random Plugin","archived":false,"fork":false,"pushed_at":"2016-01-06T19:31:30.000Z","size":78,"stargazers_count":7,"open_issues_count":4,"forks_count":2,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-04-19T07:42:26.828Z","etag":null,"topics":["grav","grav-plugin","random","taxonomy"],"latest_commit_sha":null,"homepage":"https://getgrav.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getgrav.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-02T20:49:44.000Z","updated_at":"2024-05-28T22:57:55.000Z","dependencies_parsed_at":"2022-08-31T04:23:22.682Z","dependency_job_id":null,"html_url":"https://github.com/getgrav/grav-plugin-random","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getgrav%2Fgrav-plugin-random","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getgrav%2Fgrav-plugin-random/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getgrav%2Fgrav-plugin-random/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getgrav%2Fgrav-plugin-random/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getgrav","download_url":"https://codeload.github.com/getgrav/grav-plugin-random/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251158878,"owners_count":21545048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grav","grav-plugin","random","taxonomy"],"created_at":"2024-11-11T19:12:29.665Z","updated_at":"2025-04-29T09:31:22.427Z","avatar_url":"https://github.com/getgrav.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grav Random Plugin\n\n`Random` is a [Grav][grav] Plugin which allows a random article to load based on its taxonomy filters.\n\n# Installation\n\nInstalling the Random 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. \n\n## GPM Installation (Preferred)\n\nThe 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:\n\n    bin/gpm install random\n\nThis will install the Random plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your/site/grav/user/plugins/random`.\n\n## Manual Installation\n\nTo 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 `random`. You can find these files either on [GitHub](https://github.com/getgrav/grav-plugin-random) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras).\n\nYou should now have all the plugin files under\n\n    /your/site/grav/user/plugins/random\n\n\u003e\u003e NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav), the [Error](https://github.com/getgrav/grav-plugin-error) and [Problems](https://github.com/getgrav/grav-plugin-problems) plugins, and a theme to be installed in order to operate.\n\n# Usage\n\n`Random` creates a **route** that you define. Based on the **taxonomy** filters, it picks a random item.\n\nBy default `Random` looks for all page that are have taxonomy that match those in the plugin's `filter` settings.  For this content to find _anything_ you need to define at\nleast one page with a matching taxonomy.  As the default value of the filter is `category: blog` you must have at least one page with this taxonomy. For example:\n\n    ---\n    title: Home\n    taxonomy:\n        category: blog\n    ---\n\n    # Grav is Running!\n    ## You have installed **Grav** successfully\n\n    Congratulations! You have installed the **Base Grav Package** that provides a **simple page** and the default **antimatter** theme to get you started.\n\n\n# Settings Defaults\n\n    route: /random\n    filters:\n        category: blog\n\n# Customizing the Settings\n\nTo customize the plugin, you first need to create an override config. To do so, create the folder `user/config/plugins` (if it doesn't exist already) and copy the [random.yaml](random.yaml) config file in there.\n\nNow you can edit it and tweak it however you prefer.\n\nFor further help with the `filters` settings, please refer to our [Taxonomy][taxonomy] and [Headers][headers] documentation.\n\n# Creating a \"Random Article\" Button\n\n![Random](assets/readme_1.png)\n\nIn our [Blog Skeleton](http://demo.getgrav.org/blog-skeleton/) we placed a button in the sidebar that pulls up a random blog post. Here is the code we used in the `sidebar.html.twig` template file to create this button.\n\n    \u003ca class=\"button\" href=\"{{ base_url_relative }}/random\"\u003e\u003ci class=\"fa fa-retweet\"\u003e\u003c/i\u003e I'm Feeling Lucky!\u003c/a\u003e\n\nThis button forwards the user to `/random` which is configured as the route for the random plugin. The `random.yaml` configuration file contains the following:\n\n    enabled: true\n    route: /random\n    filters: { category: blog}\n    filter_combinator: and    \n\n# Updating\n\nAs development for the Random 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 Random is easy, and can be done through Grav's GPM system, as well as manually.\n\n## GPM Update (Preferred)\n\nThe 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:\n\n    bin/gpm update random\n\nThis command will check your Grav install to see if your Random 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.\n\n## Manual Update\n\nManually updating Random is pretty simple. Here is what you will need to do to get this done:\n\n* Delete the `your/site/user/plugins/random` directory.\n* Download the new version of the Random plugin from either [GitHub](https://github.com/getgrav/grav-plugin-random) or [GetGrav.org](http://getgrav.org/downloads/plugins#extras).\n* Unzip the zip file in `your/site/user/plugins` and rename the resulting folder to `random`.\n* 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`.\n\n\u003e 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.\n\n[taxonomy]: http://learn.getgrav.org/content/taxonomy\n[headers]: http://learn.getgrav.org/content/headers\n[grav]: http://github.com/getgrav/grav\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetgrav%2Fgrav-plugin-random","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetgrav%2Fgrav-plugin-random","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetgrav%2Fgrav-plugin-random/lists"}