Include external files

Hi. I generate a new email every day (avoid spamming). All old addresses are deleted. I could include the plain text files containing only the current address in my WordPress pages without a problem … because of php.
Is there any possibility to get this feature working in Grav / Markdown, too, as it is a showstopper for me in using Grav. I already tried the solutions at, but they did not work.
Whould be great if this would work.
Greetz, Gabriel

Add.: Some pseudocode:

[Write me](mailto:{{../external/file/here}})

This could easily be done with a very simple plugin that simply installed a twig extension which in turn wrapped a simple php include.

Alternatively, you could simply put your email into a custom yaml file in /user/config.

For example create a file called: /user/config/gabbalo.yaml (name doesn’t matter really, but is used when you retrieve the value).

In that file you simply have this:


Then in your content (as long as you have Twig processing enabled, and also Twig first processing, you can put this in your content:

[Write me](mailto:{{ }})

BTW, if you put this in a twig template in your theme, rather than page content, you don’t need that page processing stuff.

That will effectively do the same thing without the security implications of including arbitrary files.

email: -> config/email.yaml
and {{ item.text }} in the template works like a charm.
Thanks for your help, even if I now must make a workaround to fit this in my environment.
The file is placed in the docroot and contains only the address, not the ‘email:’ part. I already tried to use symlinks, but that broke the whole page xD
Perhaps I will be able to modify the script to create the correct file-content at the correct location (additionally to the original file).
Again, thank you for your quick advice =)

you should be able to symlink that one file:

$ ln -s email.yaml user/config/email.yaml