Refactored /templates and /resources into a single /themes folder.
This commit is contained in:
parent
d5458c5a0f
commit
fca2b4dc6a
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"docs_directory": "docs",
|
"docs_directory": "docs",
|
||||||
|
"themes_directory": "themes",
|
||||||
|
|
||||||
"title": "My Project",
|
"title": "My Project",
|
||||||
"tagline": "My Stylish Documentation",
|
"tagline": "My Stylish Documentation",
|
||||||
|
@ -30,6 +30,9 @@ class Daux
|
|||||||
/** @var string */
|
/** @var string */
|
||||||
private $docs_path;
|
private $docs_path;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $themes_path;
|
||||||
|
|
||||||
/** @var Processor */
|
/** @var Processor */
|
||||||
protected $processor;
|
protected $processor;
|
||||||
|
|
||||||
@ -90,6 +93,18 @@ class Daux
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setThemesPath($path)
|
||||||
|
{
|
||||||
|
$this->themes_path = $path;
|
||||||
|
if (!is_dir($this->themes_path) &&
|
||||||
|
!is_dir($this->themes_path = $this->local_base . DIRECTORY_SEPARATOR . $this->themes_path)
|
||||||
|
) {
|
||||||
|
throw new Exception('The Themes directory does not exist. Check the path again : ' . $this->themes_path);
|
||||||
|
}
|
||||||
|
$this->options['themes_path'] = $this->themes_path;
|
||||||
|
$this->options['templates'] = $this->themes_path . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'templates';
|
||||||
|
}
|
||||||
|
|
||||||
public function setDocumentationPath($path)
|
public function setDocumentationPath($path)
|
||||||
{
|
{
|
||||||
$this->docs_path = $path;
|
$this->docs_path = $path;
|
||||||
@ -98,6 +113,7 @@ class Daux
|
|||||||
) {
|
) {
|
||||||
throw new Exception('The Docs directory does not exist. Check the path again : ' . $this->docs_path);
|
throw new Exception('The Docs directory does not exist. Check the path again : ' . $this->docs_path);
|
||||||
}
|
}
|
||||||
|
$this->options['docs_path'] = $this->docs_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -172,7 +188,8 @@ class Daux
|
|||||||
'mode' => $this->mode,
|
'mode' => $this->mode,
|
||||||
'local_base' => $this->local_base,
|
'local_base' => $this->local_base,
|
||||||
'docs_path' => $this->docs_path,
|
'docs_path' => $this->docs_path,
|
||||||
'templates' => $this->internal_base . DIRECTORY_SEPARATOR . 'templates',
|
'themes_path' => $this->themes_path,
|
||||||
|
'templates' => $this->themes_path . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'templates'
|
||||||
];
|
];
|
||||||
$this->options->conservativeMerge($default);
|
$this->options->conservativeMerge($default);
|
||||||
|
|
||||||
|
@ -30,9 +30,8 @@ class DauxHelper
|
|||||||
*/
|
*/
|
||||||
public static function getTheme($params, $current_url)
|
public static function getTheme($params, $current_url)
|
||||||
{
|
{
|
||||||
$theme_folder = $params['local_base'] . DIRECTORY_SEPARATOR . 'resources' .
|
$theme_folder = $params['themes_path'] . DIRECTORY_SEPARATOR . $params['html']['theme'];
|
||||||
DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $params['html']['theme'];
|
$theme_url = $params['base_url'] . $params['themes_directory'] . '/' . $params['html']['theme'] . '/';
|
||||||
$theme_url = $params['base_url'] . "resources/themes/" . $params['html']['theme'] . '/';
|
|
||||||
|
|
||||||
$theme = array();
|
$theme = array();
|
||||||
if (is_file($theme_folder . DIRECTORY_SEPARATOR . "config.json")) {
|
if (is_file($theme_folder . DIRECTORY_SEPARATOR . "config.json")) {
|
||||||
|
@ -22,6 +22,7 @@ class Server
|
|||||||
public static function serve()
|
public static function serve()
|
||||||
{
|
{
|
||||||
$daux = new Daux(Daux::LIVE_MODE);
|
$daux = new Daux(Daux::LIVE_MODE);
|
||||||
|
$daux->setThemesPath($daux->getParams()['themes_directory']);
|
||||||
$daux->setDocumentationPath($daux->getParams()['docs_directory']);
|
$daux->setDocumentationPath($daux->getParams()['docs_directory']);
|
||||||
$daux->initializeConfiguration();
|
$daux->initializeConfiguration();
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
8
themes/daux-blue/config.json
Normal file
8
themes/daux-blue/config.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"favicon": "<theme_url>img/favicon-blue.png",
|
||||||
|
"css": ["<theme_url>css/theme.min.css"],
|
||||||
|
"fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"],
|
||||||
|
"js": [],
|
||||||
|
"require-jquery": true,
|
||||||
|
"bootstrap-js": false
|
||||||
|
}
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user