This repository has been archived by the owner. It is now read-only.
A Grav Gantry 5 Particle that displays a link to edit the current Grav page stored in a Git repository (i.e. GitHub or GitLab).
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Gantry 5 'Edit/View Page in Git' Particle for Grav

Particles are small, modular blocks with preset scripting that enable you to add elements to your Grav Gantry 5 pages.

Installing the Particle

Before installing and using the Particle, it is suggested you temporarily enable Gantry's Development Mode

  1. Open the folder for your active theme in the user/data/gantry5/themes/ folder of your Gantry installation. For example, if you are using the Helium theme open the folder user/data/gantry5/themes/g5_helium.
  2. If a particles folder already exists within the theme folder open it, otherwise create it.
  3. Upload edit_view_page_in_git.html.twig and edit_view_page_in_git.yaml files into the particles folder. For example, if you are using the Helium theme copy the two particle files into user/data/gantry5/themes/g5_helium/particles.

The perfect companion to this Gantry 5 particle is the Grav GitSync Plugin.

Grav 'Edit/View in Git' Particle Setup

Particle Options

'Edit this Page' options

Page Options

Once the particle is installed, Grav pages will support the following Page Header/FrontMatter option:

hide_git_repo_link: true    # hide Git Repository edit link for this page, up to but not including the '/pages/...' For example, ''.  
git_repo_link_url:   # to override the automatically calculated Git Repository URL
git_repo_link_text: View in Markdown   # to override the default URL text label

This Particle is also included in the Grav OER Content Space Skeleton.