Skip to content

About

The Redirects component theme for Cecil provides support of _redirects file generation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Redirects component theme

The Redirects component theme for Cecil provides support of _redirects file generation.

After installation and without any configuration, this component theme generates a _redirects file containing HTML redirections created by Cecil, in all languages (automatic or created manually with the redirect front matter variable).

Services that support the _redirects file:

Installation

composer require cecil/theme-redirects

Or download the latest archive and uncompress its content in themes/redirects.

Usage

Add redirects in the theme section of your site configuration:

theme:
  - redirects

Add redirections

server:
  redirects:
    - from: https://xxxxxx/*
      to: https://xxxxxx/:splat
      status: 301 # HTTP status code, optional (301 by default if `force` is set)
      force: true # redirect even if the file exists, optional

Development

The demo/ website uses the theme under development and covers the supported cases (multilingual aliases, redirect front matter, redirections with and without status / force):

php demo/link.php
php cecil.phar build demo

The generated demo/_site/_redirects file must match demo/expected/_redirects: this is checked by the Test workflow.

License

Redirects is a free software distributed under the terms of the MIT license.

© Arnaud Ligny

About

The Redirects component theme for Cecil provides support of _redirects file generation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages