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

Create `redirects` global variable #97

Closed allejo closed 4 years ago

allejo commented 5 years ago

The way stakx currently handles redirects is by creating an HTML file with a <meta> redirect. Since redirects should happen at the server level, expose a new global redirects object or array that has a mapping of all the redirects in a given site.

Something like this:

redirects = [
  '/original/path/' => '/new/path/',
]

Using this new object, people will be able to generate their own .htacess or _redirects (Netlify) files by looping through its contents.