Grav

From IndieWeb
(Redirected from grav)

Grav is an open source flat-file CMS built on PHP, with Twig templating, and YAML + Markdown for storing articles (YAML for metadata, Markdown for the content).

Introduction

Grav uses its filesystem as a database, and heavily relies on caching (filesystem, memcache, redis…)

There's an admin plugin with a nice user-interface which allows to:

  • add/edit pages and articles
  • configure the whole system and the plugins
  • run updates and backups
  • clear the cache manually

Grav is not a static site generator, as it handles dynamic operations via plugins using an eventing system. Yet it is not a Wordpress-like CMS that renders all templates on every request, as it caches rendered templates (among others).

As a concept, Grav brings the best of both worlds. But the current implementation is far from scalable (Grav team recommends setups with at max a few thousand pages).

Pros

  • Fast setup, amazing documentation
  • Nice responsive design
  • Many useful plugins
  • Multi-language support (url-based differenciation, support for language-based slugs)

Cons

  • Dates are not translated
  • Not optimized for big websites (1000s of pages), as building collections/taxonomies (categories, tags, events) requires parsing through all of the pages (can be made faster with SSDs, but still requires lots of RAM)

Setup

You can find both the Grav core and a package with the Admin plugin in the downloads section of the Grav site. If you download the package, simply extract it, and point your web server there to be guided through setup.

Sample configuration files are available for nginx, caddy, Apache, IIS and lighttpd.

Updates

Updates can be made through the admin interface (from the main dashboard), or using the command-line tool, from your webroot : bin/gpm selfupgrade

Backups

Although backups are achievable through the web interface, data storage within Grav only relies on files, so making daily backups of your website can be as easy as a cron job running rdiff/rsync for the user/ folder in the webroot.

Indieweb

IndieAuth

Robert van Bregt has created a basic IndieAuth plugin that will inject authentication and token endpoints into your homepage.

Microformats

The default Antimatter theme supports basic microformats2 out-of-the-box. Support for h-feed name and description is available in a fork of the Antimatter theme. The About Me plugin adds additional information, including h-card on the home page and links to your identity in silos and other sites.

Themes and plugins generally provide full instructions for adding either via the command line or through the Grav admin interface.

More microformats

The events plugin has a fork adding microformats (no RSVP support yet).

Open Graph / Twitter Cards

To automatically generate og: and twitter: tags for your pages (can be overriden on a per-page basis), there's the socialmeta plugin.

RSS

OleVik has written a plugin that will display RSS feeds in a Grav site. This can be useful for bringing in content from elsewhere.

Webmention

There is a Webmention plugin marked as "beta", with Vouch support and a published implementation report against the specification.

Jeremy Cherfas: I tried using it and in the end gave up because the data it returned were so inconsistent, depending on the source markup. Tried to get it to use XRay instead but my ability wasn't up to it then.

User:Rosemaryorchard.com is working on an improved plugin.

rel=me

Robert van Bregt has created the Rel Me plugin than can add rel-me links to a site.

Micropub

micropub is not (yet) supported natively or through a plugin. However, it should be feasible to create (a fork of) nanopub. Rosemary Orchard is working on an endpoint plugin in early 2019. Metbril also has a plugin (in progress) to provide basic support for post, reply and bookmark posts.


IndieWeb Examples

Websites running Grav:

Jeremy Cherfas

Robert van Bregt

  • Robert van Bregt has migrated from WordPress to Grav since 2019-01-01.
    • Customized Antimatter theme (Microformats)
    • IndieAuth plugin and RelMe plugin.
    • He is working on a basic Micropub plugin.
    • Has not decided on what to use for Webmention, a plugin or external service.

Max Westen

  • Max Westen has migrated from Statamic to Grav since 2019-01-06.
    • Customised Quark theme
    • IndieAuth plugin
    • Instead of using the AboutMe and RelMe plugin, just using twig includes for this info
    • Looking into Webmentions and Micropub

Nikhil Jha

  • Nikhil Jha runs his blog with Grav. It accepts and sends Webmentions, but does not display accepted mentions... yet. // Robertvanbregt.nl (talk) 09:08, 23 December 2018 (PST) Your site appears to be running WordPress?

Previous Examples

cmal

Rosemary Orchard

See Also

Open Source IndieWeb related projects and tools
Topics Why open source? β€’ How to open source a project β€’ Open for contributions β€’ IndieWeb Principles
PHP b2evolution β€’ CASSIS β€’ Known β€’ Falcon (portions) β€’ p3k β€’ stapibas β€’ dobrado β€’ Grav β€’ Miniflux-legacy β€’ ProcessWire β€’ Reader Self β€’ Textpattern β€’ tt-rss β€’ Twyne β€’ TYPO3
WordPress (PHP) Indieweb Plugin β€’ Webmention β€’ Semantic Linkbacks β€’ Micropub β€’ IndieAuth β€’ Post Kinds β€’ Syndication Links β€’ WebSub plugins β€’ See Template:WordPress for others.
Python Bridgy Fed β€’ BeautifulSoup β€’ Bleach β€’ Bundle β€’ django CMS β€’ IndieWeb Search β€’ IndieWeb Utils β€’ kaku β€’ mf2util β€’ Nefelibata β€’ ninka β€’ Publ β€’ python-indieweb β€’ Red Wind β€’ Requests β€’ ronkyuu β€’ Woodwind
Ruby Dark Matter β€’ Feedbin β€’ FrancisCMS β€’ Micropublish β€’ Publify β€’ Ruby on Rails β€’ Sinatra β€’ Singulus β€’ Transformative β€’ webmention.io β€’ Jekyll
JavaScript AerosolCMS β€’ CASSIS β€’ Ghost β€’ Camel β€’ IndieKit β€’ Eleventy
Others Hugo (Go) β€’ Firefox β€’ NetNewsWire