mirror of
https://github.com/getgrav/grav.git
synced 2026-03-04 19:41:36 +01:00
customizable page types
This commit is contained in:
@@ -30,6 +30,7 @@ pages:
|
||||
special_chars: # List of special characters to automatically convert to entities
|
||||
'>': 'gt'
|
||||
'<': 'lt'
|
||||
types: 'txt|xml|html|json|rss|atom' # Pipe separated list of valid page types
|
||||
|
||||
cache:
|
||||
enabled: true # Set to true to enable caching
|
||||
|
||||
@@ -84,7 +84,11 @@ class Uri
|
||||
|
||||
// remove the extension if there is one set
|
||||
$parts = pathinfo($uri);
|
||||
if (preg_match("/\.(txt|xml|html|json|rss|atom)$/", $parts['basename'])) {
|
||||
|
||||
// set the original basename
|
||||
$this->basename = $parts['basename'];
|
||||
|
||||
if (preg_match("/\.(".$config->get('system.pages.types').")$/", $parts['basename'])) {
|
||||
$uri = rtrim($parts['dirname'], '/').'/'.$parts['filename'];
|
||||
$this->extension = $parts['extension'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user