Merge branch 'develop' into feature/updated_htaccess

This commit is contained in:
Andy Miller
2014-08-25 09:35:05 -06:00
9 changed files with 103 additions and 64 deletions

View File

@@ -8,7 +8,7 @@
"require": {
"php": ">=5.4.0",
"twig/twig": "~1.16",
"erusev/parsedown-extra": "~0.2",
"erusev/parsedown-extra": "dev-master",
"symfony/yaml": "~2.5",
"symfony/console": "~2.5",
"symfony/event-dispatcher": "~2.5",

View File

@@ -32,15 +32,16 @@ twig:
auto_reload: true # Refresh cache on changes
autoescape: false # Autoescape Twig vars
assets: # Configuration for Assets Manager (JS, CSS)
css_pipeline: false # The CSS pipeline is the unification of multiple CSS resources into one file
css_minify: true # Minify the CSS during pipelining
css_rewrite: true # Rewrite any CSS relative URLs during pipelining
js_pipeline: false # The JS pipeline is the unification of multiple JS resources into one file
js_minify: true # Minify the JS during pipelining
assets: # Configuration for Assets Manager (JS, CSS)
css_pipeline: false # The CSS pipeline is the unification of multiple CSS resources into one file
css_minify: true # Minify the CSS during pipelining
css_rewrite: true # Rewrite any CSS relative URLs during pipelining
js_pipeline: false # The JS pipeline is the unification of multiple JS resources into one file
js_minify: true # Minify the JS during pipelining
debugger:
enabled: false # Enable Grav debugger and following settings
mode: detect # Mode tracy Debugger should be set to when enabled: detect|development|production
strict: false # Throw fatal error also on PHP warnings and notices
max_depth: 10 # How many nested levels to display for objects or arrays
log:

View File

@@ -11,6 +11,7 @@ class Debugger
{
const PRODUCTION = TracyDebugger::PRODUCTION;
const DEVELOPMENT = TracyDebugger::DEVELOPMENT;
const DETECT = TracyDebugger::DETECT;
public function __construct($mode = self::PRODUCTION)
{
@@ -27,6 +28,7 @@ class Debugger
/** @var Config $config */
$config = $grav['config'];
$mode = $config->get('system.debugger.mode');
TracyDebugger::$logDirectory = $config->get('system.debugger.log.enabled') ? LOG_DIR : null;
TracyDebugger::$maxDepth = $config->get('system.debugger.max_depth');
@@ -39,7 +41,16 @@ class Debugger
if (function_exists('ini_set')) {
ini_set('display_errors', true);
}
TracyDebugger::$productionMode = TracyDebugger::DEVELOPMENT;
if ($mode == strtolower('detect')) {
TracyDebugger::$productionMode = self::DETECT;
} elseif ($mode == strtolower('production')) {
TracyDebugger::$productionMode = self::PRODUCTION;
} else {
TracyDebugger::$productionMode = self::DEVELOPMENT;
}
}
}

View File

@@ -70,6 +70,7 @@ class Page
protected $modular_twig;
protected $process;
protected $summary_size;
protected $markdown_extra;
/**
* @var Page Unmodified (original) version of the page. Used for copying and moving the page.
@@ -201,6 +202,9 @@ class Page
if (isset($this->header->date)) {
$this->date = strtotime($this->header->date);
}
if (isset($this->header->markdown_extra)) {
$this->markdown_extra = (bool)$this->header->markdown_extra;
}
if (isset($this->header->taxonomy)) {
foreach ($this->header->taxonomy as $taxonomy => $taxitems) {
$this->taxonomy[$taxonomy] = (array)$taxitems;
@@ -214,7 +218,9 @@ class Page
$this->process[$process] = $status;
}
}
}
return $this->header;
}
@@ -1517,7 +1523,9 @@ class Page
{
/** @var Config $config */
$config = self::$grav['config'];
if ($config->get('system.pages.markdown_extra')) {
// get the appropriate setting for markdown extra
if (isset($this->markdown_extra) ? $this->markdown_extra : $config->get('system.pages.markdown_extra')) {
$parsedown = new MarkdownExtra($this);
} else {
$parsedown = new Markdown($this);

View File

@@ -539,8 +539,14 @@ class Pages
}
}
// Sort by the new list.
asort($list);
// handle special case when order_by is random
if ($order_by == 'random') {
$list = $this->array_shuffle($list);
} else {
// else just sort the list according to specified key
asort($list);
}
// Move manually ordered items into the beginning of the list. Order of the unlisted items does not change.
if (is_array($manual) && !empty($manual)) {
@@ -568,4 +574,17 @@ class Pages
$this->sort[$path][$order_by][$key] = $info;
}
}
// Shuffles and associative array
protected function array_shuffle($list) {
$keys = array_keys($list);
shuffle($keys);
$new = array();
foreach($keys as $key) {
$new[$key] = $list[$key];
}
return $new;
}
}

View File

@@ -3,7 +3,7 @@ home:
pages:
theme: antimatter
markdown_extra: true
markdown_extra: false
process:
markdown: true
twig: false

2
vendor/autoload.php vendored
View File

@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit3f16975091c92a1711741b1ac4f955c3::getLoader();
return ComposerAutoloaderInitc72d8fa047c31604816395255e8b35b9::getLoader();

View File

@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit3f16975091c92a1711741b1ac4f955c3
class ComposerAutoloaderInitc72d8fa047c31604816395255e8b35b9
{
private static $loader;
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit3f16975091c92a1711741b1ac4f955c3
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit3f16975091c92a1711741b1ac4f955c3', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitc72d8fa047c31604816395255e8b35b9', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit3f16975091c92a1711741b1ac4f955c3', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitc72d8fa047c31604816395255e8b35b9', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit3f16975091c92a1711741b1ac4f955c3
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequire3f16975091c92a1711741b1ac4f955c3($file);
composerRequirec72d8fa047c31604816395255e8b35b9($file);
}
return $loader;
}
}
function composerRequire3f16975091c92a1711741b1ac4f955c3($file)
function composerRequirec72d8fa047c31604816395255e8b35b9($file)
{
require $file;
}

View File

@@ -40,52 +40,6 @@
"parser"
]
},
{
"name": "erusev/parsedown-extra",
"version": "0.2.0",
"version_normalized": "0.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown-extra.git",
"reference": "7578fe28ce42e7a1fff4ba2aada3807c4c03d04b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown-extra/zipball/7578fe28ce42e7a1fff4ba2aada3807c4c03d04b",
"reference": "7578fe28ce42e7a1fff4ba2aada3807c4c03d04b",
"shasum": ""
},
"require": {
"erusev/parsedown": "~1.0"
},
"time": "2014-08-16 11:20:35",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"ParsedownExtra": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "An extension of Parsedown that adds support for Markdown Extra.",
"homepage": "https://github.com/erusev/parsedown-extra",
"keywords": [
"markdown",
"markdown extra",
"parsedown",
"parser"
]
},
{
"name": "doctrine/cache",
"version": "v1.3.0",
@@ -711,5 +665,51 @@
"user agent",
"useragent"
]
},
{
"name": "erusev/parsedown-extra",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown-extra.git",
"reference": "7578fe28ce42e7a1fff4ba2aada3807c4c03d04b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown-extra/zipball/7578fe28ce42e7a1fff4ba2aada3807c4c03d04b",
"reference": "7578fe28ce42e7a1fff4ba2aada3807c4c03d04b",
"shasum": ""
},
"require": {
"erusev/parsedown": "~1.0"
},
"time": "2014-08-16 11:20:35",
"type": "library",
"installation-source": "source",
"autoload": {
"psr-0": {
"ParsedownExtra": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "An extension of Parsedown that adds support for Markdown Extra.",
"homepage": "https://github.com/erusev/parsedown-extra",
"keywords": [
"markdown",
"markdown extra",
"parsedown",
"parser"
]
}
]