In order to federate two different grav websites we will need
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.
[plugin:page-inject](remote://circex/circenses/_highlights/)
render as
info [at] circex [dot] org