direct federation grav

Requirements

  • useful mainly for modular content
  • CSS inconsistencies

In order to federate two different grav websites we will need

  1. grav
  2. with the same version of the page-inject plugin
  3. configure the plugin https://github.com/getgrav/grav-plugin-page-inject/blob/master/README.md#remote-injects

It is now possible to retrieve remote content from another Grav instance as long as both of the sites are running the latest version of the page-inject plugin. First in the client Grav instance you need to define a remote connection to another Grav server in the plugin configuration. For example:

remote_injections: dev: https://dev.somehost.com/ foo: https://foo.com/bar

This will then allow you to inject page content from one Grav instance to another using this syntax:

[plugin:page-inject](remote://dev/home/modular/_callout)

N.B.: to escape markdown code, add a backslash "\" before every square bracket "["

\[code to be printed\]

is rendered as

[code to be printed]

and for the shortcode version:

[page-inject path="remote://dev/home/modular/_callout" /]

Where the remote://dev protocol tells the plugin to retrieve the requested page from the dev injection configuration via the path /home/modular/_callout.

This is particularly useful for modular content that is already a snippet of content that is being reused on the server. This will retrieve the content, and because a modular page's content is pre-rendered with the appropriate Twig template, it will include all the HTML of the modular page. If you request a regular page (non-modular), there will be no Twig

and just plain HTML content will be sent.

Example of remote page injection - C.I.R.C.E.

[plugin:page-inject](remote://circex/circenses/_highlights/)

render as

collaborano @ C.I.R.C.E.

educazione | formazione di formatori | programmazione | filosofia | sociologia | traduzioni | web dev | social media stuff | scrittura collaborativa | radio — e molto di più.

info [at] circex [dot] org

Agnese Trocchi

Social media strategist, artista multimediale, copywriter e storyteller.

Davide Fant

Formatore e pedagogista

Carlo B. Milani

Traduttore e factotum. Ha scritto con l'eteronimo Ippolita fino al 2018.

Caterina Annese

Educatrice, promotrice e agitatrice culturale, è tra le fondatrici dello spazio culturale Zei a Lecce.

Maurizio "Graffio" Mazzoneschi

Esperto di tecnologie della comunicazione, programmatore, formatore

Mistery Circens n.1

Emacs lover. Vulgo guru. Traduttore. Filosofo.

Mistery Circens n.2

Amante dei siti web statici. Sociologo.

Mistery Circens n.3

Urban hacker, filosofo, FLOShare Developer

Nethood

Bridging the digital with the physical space; building together local solutions for local needs.

Alessia Bleve

Mediatrice culturale e presidente dello spazio culturale Zei a Lecce.