Skip to content

gebeer/grav-plugin-twig-getfilecontents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TwigGetfilecontentsPlugin

Plugin for grav CMS that adds the TWIG function getfilecontents($filePath) to embed contents of page files (e.g. SVG) inline.

Installation

To install this plugin, just download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to twig-getfilecontents. You can find these files on GitHub or via GetGrav.org.

You should now have all the plugin files under

/your/site/grav/user/plugins/twig-getfilecontents

NOTE: This plugin is a modular component for Grav which requires Grav and the Error and Problems to operate.

Usage

Anywhere in your Twig templates use getfilecontents($filePath) where $filePath is the physical path to the file you want to embed.
For a page file this would be something like page.media.files|first.filepath

About

Plugin for grav CMS that adds the TWIG function getfilecontents($filePath) to embed contents of page files (e.g. SVG) inline.

Resources

License

Stars

10 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages