diff --git a/daux.phar b/daux.phar index fd21107..618cc0a 100755 Binary files a/daux.phar and b/daux.phar differ diff --git a/docs/10_For_Developers/Creating_a_Theme.md b/docs/10_For_Developers/Creating_a_Theme.md index 9218e22..dada75e 100644 --- a/docs/10_For_Developers/Creating_a_Theme.md +++ b/docs/10_For_Developers/Creating_a_Theme.md @@ -11,7 +11,7 @@ Here is an example `config.json` file : "favicon": "img/favicon.png", "css": ["css/theme.min.css"], "js": [], - "fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], + "fonts": ["https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], "variants": { "blue": { "favicon": "img/favicon-blue.png", diff --git a/docs/_index.md b/docs/_index.md index d774743..297da74 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -6,7 +6,7 @@

Features


-
+
#### For Authors @@ -21,7 +21,7 @@ * [Table of Contents](!Features/Table_of_contents)
-
+
#### For Developers @@ -31,7 +31,7 @@ * Work with pages metadata
-
+
#### For Marketing @@ -45,7 +45,6 @@
-

diff --git a/gulpfile.js b/gulpfile.js index 6e8e15a..5c1c569 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,127 +8,14 @@ var gulp = require('gulp'), sourcemaps = require('gulp-sourcemaps'); var resources = { - daux:{source: "themes/daux/less/theme.less", dest: "themes/daux/css/"}, daux_blue:{source: "themes/daux/less/theme-blue.less", dest: "themes/daux/css/"}, daux_green:{source: "themes/daux/less/theme-green.less", dest: "themes/daux/css/"}, daux_navy:{source: "themes/daux/less/theme-navy.less", dest: "themes/daux/css/"}, daux_red:{source: "themes/daux/less/theme-red.less", dest: "themes/daux/css/"}, + daux_singlepage:{source: "themes/daux_singlepage/less/main.less", dest: "themes/daux_singlepage/css/"} }; -var unusedRules = [ - //We only use one glyphicon ... - ".glyphicon-", - "!.glyphicon-chevron-right", - "!.glyphicon-search", - - //we dont need all buttons - ".btn-", - "!.btn-group", - "!.btn-default", - "!.btn-sm", - "!.btn-primary", - "!.btn-secondary", - "!.btn-hero", - "!.btn-sidebar", - ".caret", - - //Typography - ".h1", - ".h2", - ".h3", - ".h4", - ".h5", - ".h6", - ".small", - - // We need only small columns - ".col-", - "!.col-sm", - - // We don't use a lot of navs and navbars - ".navbar-fixed", - ".navbar-inverse", - ".navbar-default", - ".nav-pills", - ".nav-tabs", - ".nav-stacked", - ".nav-justified", - - // And a few others we don't use - ".bg-", - ".table" -]; - -function prepare_rules(rules) { - var regexes = {inclusion: [], exclusion: []}, rule, pattern, regex, exclusion; - - for (rule in rules) { - if (!rules.hasOwnProperty(rule)) continue; - - pattern = rules[rule]; - - exclusion = pattern.indexOf('!') === 0; - if (exclusion) { pattern = pattern.slice(1); } - - regex = pattern.replace('.', '\\.').replace('*', '(.*)'); - - if (exclusion) { - regexes.exclusion.push(new RegExp(regex)); - } else { - regexes.inclusion.push(new RegExp(regex)); - } - } - - return regexes; -} - -function processPatterns(patterns, string) { - var i; - - for (i in patterns.exclusion) { - if (!patterns.exclusion.hasOwnProperty(i)) continue; - if (string.match(patterns.exclusion[i])) return false; - } - - for (i in patterns.inclusion) { - if (!patterns.inclusion.hasOwnProperty(i)) continue; - if (string.match(patterns.inclusion[i])) return true; - } -} - -function removeUnusedRules(rules) { - var regexes = prepare_rules(rules); - - return function(css) { - css.walkRules(function (rule) { - var removedSome = false, - selectors = rule.selectors, - i; - - for (i = 0; i < selectors.length; i++) { - if (processPatterns(regexes, selectors[i])) { - selectors.splice(i, 1); - i--; - removedSome = true; - } - } - - if(removedSome) { - if (selectors.length == 0) { - rule.remove(); - } else { - rule.selectors = selectors; - } - } - }); - - return css; - } -} - - - function createTask(source, dest) { return function() { var nano_options = { @@ -145,7 +32,6 @@ function createTask(source, dest) { .pipe(plumber()) .pipe(less()) .pipe(postcss([ - removeUnusedRules(unusedRules), require('cssnano')(nano_options) ])) .pipe(rename({suffix: '.min'})) diff --git a/libs/Format/HTML/Template.php b/libs/Format/HTML/Template.php index 01d13b5..55bdbdd 100644 --- a/libs/Format/HTML/Template.php +++ b/libs/Format/HTML/Template.php @@ -79,7 +79,7 @@ class Template foreach ($entries as $entry) { if (array_key_exists('children', $entry)) { - $icon = ' '; + $icon = ' '; if (array_key_exists('href', $entry)) { $link = '' . $icon . $entry['title'] . ''; @@ -92,10 +92,10 @@ class Template $link = '' . $entry['title'] . ''; } - $nav .= "
  • $link
  • "; + $nav .= ""; } - return ""; + return ""; } private function buildNavigation(Directory $tree, $path, $current_url, $base_page, $mode) @@ -113,7 +113,7 @@ class Template $nav[] = [ 'title' => $node->getTitle(), 'href' => $base_page . $link, - 'class' => $current_url === $link ? 'active' : '', + 'class' => $current_url === $link ? 'Nav__item--active' : '', ]; } elseif ($node instanceof Directory) { if (!$node->hasContent()) { @@ -124,7 +124,7 @@ class Template $folder = [ 'title' => $node->getTitle(), - 'class' => strpos($current_url, $link) === 0 ? 'open' : '', + 'class' => strpos($current_url, $link) === 0 ? 'Nav__item--open' : '', ]; if ($mode === Daux::STATIC_MODE) { @@ -157,7 +157,7 @@ class Template { switch ($separator) { case 'Chevrons': - return ' '; + return ' '; default: return $separator; } diff --git a/libs/Format/HTMLFile/Generator.php b/libs/Format/HTMLFile/Generator.php index b5c51d6..6250e2f 100644 --- a/libs/Format/HTMLFile/Generator.php +++ b/libs/Format/HTMLFile/Generator.php @@ -3,7 +3,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Todaymade\Daux\Console\RunAction; -use Todaymade\Daux\ContentTypes\Markdown\ContentType; +use Todaymade\Daux\Format\HTML\ContentTypes\Markdown\ContentType; use Todaymade\Daux\Daux; class Generator implements \Todaymade\Daux\Format\Base\Generator diff --git a/templates/content.php b/templates/content.php index 2febe38..c1ca09c 100644 --- a/templates/content.php +++ b/templates/content.php @@ -1,28 +1,24 @@ layout('theme::layout/05_page') ?> -
    +
    -