You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An easy to use class for handling YAML frontmatter in PHP.
What does this class do?
This class is a PHP implementation of JekyllFront Matter.
Any file that contains a YAML front matter block will be processed as a special file. The front matter must be the first thing in the file and must take the form of valid YAML setbetween triple-dashed lines. Here is a basic example:
---
layout: posttitle: Blogging Like a Hacker
---
Between these triple-dashed lines, you can set variables using YAML. You can access them via the fetch function. Conversion to Markdown is optional.
---
foo: bartitle: Testinfo: you can have as many custom fields as you likedate: 2005-09-16 17:20:42+00:00layout: postcomments: trueslug: testinglist: { foo: bar, bar: baz }list2:
- foo
- barlist3:
foo: barbar: baz
---
<h1>Text Here</h1><p>content</p>
Installation
Install in via Composer:
composer require modularr/yaml-front-matter
If you are using the package in a VanillaJS project make sure you have:
require_once'vendor/autoload.php';
About
An easy to use class for handling YAML frontmatter in PHP.