Merge pull request #246 from PhrozenByte/enhancement/CleanupPaths
Cleanup paths
This commit is contained in:
commit
2d6b0ad45a
@ -11,8 +11,8 @@
|
|||||||
* @license http://opensource.org/licenses/MIT
|
* @license http://opensource.org/licenses/MIT
|
||||||
* @version 0.9
|
* @version 0.9
|
||||||
*
|
*
|
||||||
* To override any of the default settings below, uncomment the line,
|
* To override any of the default settings below, copy this file to
|
||||||
* make and save the changes, then rename this file to `config.php`
|
* `config.php`, uncomment the line and make and save your changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -51,4 +51,4 @@
|
|||||||
// $config['custom_setting'] = 'Hello'; // Can be accessed by {{ config.custom_setting }} in a theme
|
// $config['custom_setting'] = 'Hello'; // Can be accessed by {{ config.custom_setting }} in a theme
|
||||||
|
|
||||||
// Keep this line
|
// Keep this line
|
||||||
return $config;
|
return $config;
|
@ -55,16 +55,16 @@ There are also certain variables that you can use in your text files:
|
|||||||
|
|
||||||
You can create themes for your Pico installation in the "themes" folder. Check out the default theme for an example of a theme. Pico uses
|
You can create themes for your Pico installation in the "themes" folder. Check out the default theme for an example of a theme. Pico uses
|
||||||
[Twig](http://twig.sensiolabs.org/documentation) for it's templating engine. You can select your theme by setting the `$config['theme']` variable
|
[Twig](http://twig.sensiolabs.org/documentation) for it's templating engine. You can select your theme by setting the `$config['theme']` variable
|
||||||
in config.php to your theme folder.
|
in `config/config.php` to your theme folder.
|
||||||
|
|
||||||
All themes must include an `index.html` file to define the HTML structure of the theme. Below are the Twig variables that are available to use in your theme:
|
All themes must include an `index.html` file to define the HTML structure of the theme. Below are the Twig variables that are available to use in your theme:
|
||||||
|
|
||||||
* `{{ config }}` - Conatins the values you set in config.php (e.g. `{{ config.theme }}` = "default")
|
* `{{ config }}` - Conatins the values you set in `config/config.php` (e.g. `{{ config.theme }}` = "default")
|
||||||
* `{{ base_dir }}` - The path to your Pico root directory
|
* `{{ base_dir }}` - The path to your Pico root directory
|
||||||
* `{{ base_url }}` - The URL to your Pico site
|
* `{{ base_url }}` - The URL to your Pico site
|
||||||
* `{{ theme_dir }}` - The path to the Pico active theme directory
|
* `{{ theme_dir }}` - The path to the Pico active theme directory
|
||||||
* `{{ theme_url }}` - The URL to the Pico active theme directory
|
* `{{ theme_url }}` - The URL to the Pico active theme directory
|
||||||
* `{{ site_title }}` - Shortcut to the site title (defined in config.php)
|
* `{{ site_title }}` - Shortcut to the site title (defined in `config/config.php`)
|
||||||
* `{{ meta }}` - Contains the meta values from the current page
|
* `{{ meta }}` - Contains the meta values from the current page
|
||||||
* `{{ meta.title }}`
|
* `{{ meta.title }}`
|
||||||
* `{{ meta.description }}`
|
* `{{ meta.description }}`
|
||||||
@ -100,8 +100,9 @@ See [http://pico.dev7studios.com/plugins](http://picocms.org/plugins)
|
|||||||
|
|
||||||
### Config
|
### Config
|
||||||
|
|
||||||
You can override the default Pico settings (and add your own custom settings) by editing config.php in the root Pico directory. The config.php file
|
You can override the default Pico settings (and add your own custom settings) by editing `config/config.php` in the Pico directory.
|
||||||
lists all of the settings and their defaults. To override a setting, simply uncomment it in config.php and set your custom value.
|
The `config/config.php.template` lists all of the settings and their defaults. To override a setting simply copy
|
||||||
|
`config/config.php.template` to `config/config.php`, uncomment the setting and set your custom value.
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
define('ROOT_DIR', realpath(dirname(__FILE__)) . '/');
|
define('ROOT_DIR', realpath(dirname(__FILE__)) . '/');
|
||||||
define('CONTENT_DIR', ROOT_DIR . 'content-sample/');
|
|
||||||
define('CONTENT_EXT', '.md');
|
|
||||||
define('LIB_DIR', ROOT_DIR . 'lib/');
|
define('LIB_DIR', ROOT_DIR . 'lib/');
|
||||||
|
define('VENDOR_DIR', ROOT_DIR . 'vendor/');
|
||||||
define('PLUGINS_DIR', ROOT_DIR . 'plugins/');
|
define('PLUGINS_DIR', ROOT_DIR . 'plugins/');
|
||||||
define('THEMES_DIR', ROOT_DIR . 'themes/');
|
define('THEMES_DIR', ROOT_DIR . 'themes/');
|
||||||
|
define('CONFIG_DIR', ROOT_DIR . 'config/');
|
||||||
define('CACHE_DIR', LIB_DIR . 'cache/');
|
define('CACHE_DIR', LIB_DIR . 'cache/');
|
||||||
|
|
||||||
require_once(ROOT_DIR . 'vendor/autoload.php');
|
define('CONTENT_EXT', '.md');
|
||||||
|
|
||||||
|
require_once(VENDOR_DIR . 'autoload.php');
|
||||||
require_once(LIB_DIR . 'pico.php');
|
require_once(LIB_DIR . 'pico.php');
|
||||||
$pico = new Pico();
|
$pico = new Pico();
|
||||||
|
@ -199,8 +199,12 @@ class Pico
|
|||||||
*/
|
*/
|
||||||
protected function get_config()
|
protected function get_config()
|
||||||
{
|
{
|
||||||
|
if (file_exists(CONFIG_DIR . 'config.php')) {
|
||||||
$this->config = @include_once(ROOT_DIR . 'config.php');
|
$this->config = require(CONFIG_DIR . 'config.php');
|
||||||
|
} else if (file_exists(ROOT_DIR . 'config.php')) {
|
||||||
|
// deprecated
|
||||||
|
$this->config = require(ROOT_DIR . 'config.php');
|
||||||
|
}
|
||||||
|
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
'site_title' => 'Pico',
|
'site_title' => 'Pico',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user