Refactored /templates and /resources into a single /themes folder.
Cette révision appartient à :
Parent
d5458c5a0f
révision
fca2b4dc6a
@ -1,5 +1,6 @@
|
||||
{
|
||||
"docs_directory": "docs",
|
||||
"themes_directory": "themes",
|
||||
|
||||
"title": "My Project",
|
||||
"tagline": "My Stylish Documentation",
|
||||
|
@ -30,6 +30,9 @@ class Daux
|
||||
/** @var string */
|
||||
private $docs_path;
|
||||
|
||||
/** @var string */
|
||||
private $themes_path;
|
||||
|
||||
/** @var 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)
|
||||
{
|
||||
$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);
|
||||
}
|
||||
$this->options['docs_path'] = $this->docs_path;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -172,7 +188,8 @@ class Daux
|
||||
'mode' => $this->mode,
|
||||
'local_base' => $this->local_base,
|
||||
'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);
|
||||
|
||||
|
@ -30,9 +30,8 @@ class DauxHelper
|
||||
*/
|
||||
public static function getTheme($params, $current_url)
|
||||
{
|
||||
$theme_folder = $params['local_base'] . DIRECTORY_SEPARATOR . 'resources' .
|
||||
DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $params['html']['theme'];
|
||||
$theme_url = $params['base_url'] . "resources/themes/" . $params['html']['theme'] . '/';
|
||||
$theme_folder = $params['themes_path'] . DIRECTORY_SEPARATOR . $params['html']['theme'];
|
||||
$theme_url = $params['base_url'] . $params['themes_directory'] . '/' . $params['html']['theme'] . '/';
|
||||
|
||||
$theme = array();
|
||||
if (is_file($theme_folder . DIRECTORY_SEPARATOR . "config.json")) {
|
||||
|
@ -22,6 +22,7 @@ class Server
|
||||
public static function serve()
|
||||
{
|
||||
$daux = new Daux(Daux::LIVE_MODE);
|
||||
$daux->setThemesPath($daux->getParams()['themes_directory']);
|
||||
$daux->setDocumentationPath($daux->getParams()['docs_directory']);
|
||||
$daux->initializeConfiguration();
|
||||
|
||||
|
Avant Largeur: | Hauteur: | Taille: 1.0 KiB Après Largeur: | Hauteur: | Taille: 1.0 KiB |
8
themes/daux-blue/config.json
Fichier normal
8
themes/daux-blue/config.json
Fichier normal
@ -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
|
||||
}
|
Avant Largeur: | Hauteur: | Taille: 106 KiB Après Largeur: | Hauteur: | Taille: 106 KiB |
Certains fichiers ne sont pas affichés car ce diff contient trop de modifications Voir plus
Chargement…
Référencer dans un nouveau ticket
Block a user