start wiki-like features support for pages
This commit is contained in:
parent
d99fb2a934
commit
172dbcf7cb
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
const ROUTER_VERSION = 8;
|
||||
const ROUTER_VERSION = 9;
|
||||
const ROUTER_MC_KEY = '4in1/routes';
|
||||
|
||||
$RouterInput = [];
|
||||
|
39
routes.php
39
routes.php
@ -6,14 +6,19 @@ return (function() {
|
||||
$files_collections = array_map(fn(FilesCollection $fn) => $fn->value, FilesCollection::cases());
|
||||
$coll_with_folder_support = [FilesCollection::WilliamFriedman->value, FilesCollection::Baconiana->value];
|
||||
|
||||
$pagename_regex = '[a-zA-Z0-9-]+';
|
||||
$wiki_root = 'notes';
|
||||
|
||||
$routes = [
|
||||
'Main' => [
|
||||
'/' => 'index',
|
||||
'{about,contacts}/' => 'about',
|
||||
'feed.rss' => 'rss',
|
||||
'([a-zA-Z0-9-]+)/' => 'page name=$(1)',
|
||||
'articles/' => 'articles',
|
||||
'articles/([a-zA-Z0-9-]+)/' => 'post name=$(1)',
|
||||
'/' => 'index',
|
||||
'{about,contacts}/' => 'about',
|
||||
'feed.rss' => 'rss',
|
||||
'('.$pagename_regex.')/' => 'page name=$(1)',
|
||||
$wiki_root.'/' => 'page name='.$wiki_root,
|
||||
$wiki_root.'/('.$pagename_regex.')/' => 'page name='.$wiki_root.'/$(1)',
|
||||
'articles/' => 'articles',
|
||||
'articles/('.$pagename_regex.')/' => 'post name=$(1)',
|
||||
],
|
||||
'Files' => [
|
||||
'files/' => 'files',
|
||||
@ -26,16 +31,18 @@ return (function() {
|
||||
'latest-{en,ru}.pdf' => 'latest lang=${1}'
|
||||
],
|
||||
'Admin' => [
|
||||
'admin/' => 'index',
|
||||
'admin/{login,logout,log}/' => '${1}',
|
||||
'([a-zA-Z0-9-]+)/{delete,edit}/' => 'page_${1} short_name=$(1)',
|
||||
'([a-zA-Z0-9-]+)/create/' => 'page_add short_name=$(1)',
|
||||
'articles/write/' => 'post_add',
|
||||
'articles/([a-zA-Z0-9-]+)/{delete,edit}/' => 'post_${1} short_name=$(1)',
|
||||
'admin/markdown-preview.ajax' => 'ajax_md_preview',
|
||||
'admin/{uploads,errors}/' => '${1}',
|
||||
'admin/{auth,actions}-log/' => '${1}_log',
|
||||
'admin/uploads/{edit_note,delete}/(\d+)/' => 'upload_${1} id=$(1)'
|
||||
'admin/' => 'index',
|
||||
'admin/{login,logout,log}/' => '${1}',
|
||||
'('.$pagename_regex.')/{delete,edit}/' => 'page_${1} short_name=$(1)',
|
||||
'('.$pagename_regex.')/create/' => 'page_add short_name=$(1)',
|
||||
$wiki_root.'/('.$pagename_regex.')/{delete,edit}/' => 'page_${1} short_name='.$wiki_root.'/$(1)',
|
||||
$wiki_root.'/('.$pagename_regex.')/create/' => 'page_add short_name='.$wiki_root.'/$(1)',
|
||||
'articles/write/' => 'post_add',
|
||||
'articles/('.$pagename_regex.')/{delete,edit}/' => 'post_${1} short_name=$(1)',
|
||||
'admin/markdown-preview.ajax' => 'ajax_md_preview',
|
||||
'admin/{uploads,errors}/' => '${1}',
|
||||
'admin/{auth,actions}-log/' => '${1}_log',
|
||||
'admin/uploads/{edit_note,delete}/(\d+)/' => 'upload_${1} id=$(1)'
|
||||
]
|
||||
];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user