xy2z / capro

PHP8 static site generator
MIT License
8 stars 2 forks source link

Access config/env variables in yaml front matter #17

Closed xy2z closed 1 year ago

xy2z commented 1 year ago

Nice to have.

It can be useful to set view's yaml-front-matter to variables from config/.env file. eg. to disable build on production (for drafts)

core.disable_build: ${{ config('app.is_production') }}

Probably best to use the same replacement as github action does ${{ like.this }} - as others are using this so this is what people are used to. The eval the content as raw php, so it can be used for config, env, and other things, eg. ${{ env('foo') }}.