stakx-io / stakx

An opinionated, powerful, and simple static website generator built in PHP
https://stakx.io/
MIT License
14 stars 3 forks source link

How should we handle global template variables? #114

Open allejo opened 4 years ago

allejo commented 4 years ago

Since the release of 0.2.0, the following template variable names are reserved and managed by stakx.

PR #113 introduces a new redirects global variable, which could conflict with any existing templates that use redirects as a variable name; this is a huge problem for BC. How should this be handled?

  1. Follow Jekyll and stuff everything into site
    • However, this poses the exact same problem but with site conflicting with configuration file keys.
  2. Global variables are prefixed so they become stakx_site or stakx.site
  3. Cross our fingers and hope no one complains or has used redirects as a variable name
The-Noah commented 3 years ago

I think the second option is a good choice. Perhaps when an option is chosen instead of removing the old ones immediately, give a warning saying it will be removed in the next major release (with steps to fix it).