Revert to old Clean_Urls flag in config.json

This commit is contained in:
Gautham Warrier 2014-09-20 01:53:30 +05:30
parent 9ab6f4307a
commit 0e8547c784
4 changed files with 14 additions and 2 deletions

View File

@ -6,6 +6,7 @@
"theme": "daux-blue",
"breadcrumbs": false,
"template": "default",
"clean_urls": false,
"toggle_code": false,
"date_modified": false,
"float": false,

View File

@ -84,6 +84,16 @@ Note: The image can be a local or remote image. Use the convention `<base_url>`
If you are interested in having a landing page for a subsection of your docs, all you need to do is add an `index.md` file to the folder. For example, `/docs/01_Examples` has a landing page for that section since there exists a `/docs/01_Examples/index.md` file. If you wish to have an landing page for a section sans the document format, use the name `_index.md`
## Clean URLs
Daux provides native support for Clean URLs provided the webserver has its URL Rewrite module enabled. To enable the same, simply set the toggle in the `config.json` file in the `/docs` folder.
```json
{
"clean_urls": true
}
```
## Configuration
To customize the look and feel of your documentation, you can create a `config.json` file in the of the `/docs` folder. The `config.json` file is a simple JSON object that you can use to change some of the basic settings of the documentation.

View File

@ -5,6 +5,7 @@
"image": "<base_url>img/app.png",
"theme": "daux-blue",
"template": "default",
"clean_urls": true,
"toggle_code": true,
"breadcrumbs": true,
"breadcrumb_separator": "Chevrons",

View File

@ -42,8 +42,6 @@
public function handle_request($url, $query = array()) {
if ($this->error) return $this->error_page;
$t = substr($url, strlen($this->base_url) + 1);
$this->params['clean_urls'] = !(strpos($t, 'index.php') === 0);
if (!$this->params['clean_urls']) $this->params['base_page'] .= 'index.php?request=';
$request = DauxHelper::get_request_from_url($url, $this->base_url);
$request = urldecode($request);
@ -207,6 +205,7 @@
$params['host'] = $this->host;
$params['tree'] = $this->tree;
$params['index'] = ($this->tree->index_page !== false) ? $this->tree->index_page : $this->tree->first_page;
$params['clean_urls'] = $this->options['clean_urls'];
$params['tagline'] = $this->options['tagline'];
$params['title'] = $this->options['title'];
@ -236,6 +235,7 @@
$params['host'] = $this->host;
$params['tree'] = $this->tree;
$params['index'] = ($this->tree->index_page !== false) ? $this->tree->index_page : $this->tree->first_page;
$params['clean_urls'] = $this->options['clean_urls'];
$params['tagline'] = $this->options['tagline'];
$params['title'] = $this->options['title'];