Description | A static content generator. |
Newcomen::Plugin::Rewrite::Clean - Clean up page targets.
This plugin will clean up the page targets. It will first split the supplied target at slashes, ignoring any empty parts (!). Then, for every singe part of the split string, the following rules will be applied:
[a-zA-Z0-9._-]
will be replaced by a single dash (-
).-
) before or after dots (.
) will be removed.-
) or dots (.
) will be replaced by single ones.-
) at the beginning and all dashes or dots (.
) at the end of the part will be
removed. A dot at the beginning is allowed (this allows, for example, .htaccess files to be
created)!If a part should be empty after these steps, this plugin will die(). If all parts are cleaned up, the rewritten target will be the single cleaned up parts joined with slash as separator.
This plugin implements the hook_rewrite_target() hook (default priority).
This is version 2014052501
.
Stefan Goebel - newcomen {at} subtype {dot} de
Copyright 2013-2014 Stefan Goebel.
This file is part of Newcomen.
Newcomen is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the license, or (at your option) any later version.
Newcomen is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Newcomen. If not, see <http://www.gnu.org/licenses/>.