From c2059e4df80c00a342bf8b8f0ca0756daf70ba25 Mon Sep 17 00:00:00 2001 From: kisselev Date: Mon, 29 Jul 2013 11:49:58 -0700 Subject: [PATCH] Added option to disable date_modified. Also began moving html/styling out of the functions/php logic. --- css/daux-blue.css | 4 ++++ css/daux-green.css | 4 ++++ css/daux-navy.css | 4 ++++ css/daux-red.css | 4 ++++ docs/config.json | 1 + index.php | 39 ++++++++++++++++++++++++++++++++++++-- less/import/daux-base.less | 3 +++ libs/functions.php | 28 ++++++++++++++------------- 8 files changed, 72 insertions(+), 15 deletions(-) diff --git a/css/daux-blue.css b/css/daux-blue.css index 9d3fadd..3b4f6fb 100644 --- a/css/daux-blue.css +++ b/css/daux-blue.css @@ -6725,6 +6725,10 @@ code { .page-header h1 { margin-top: 0px; } +/* To be applied to the same element as page-header for sites that have sub-heading content such as Last modified time */ +.page-header .sub-heading { + padding: 0px, 0px, 20px; +} pre { border: none; background-color: #82becd; diff --git a/css/daux-green.css b/css/daux-green.css index 5b557a2..2f61116 100644 --- a/css/daux-green.css +++ b/css/daux-green.css @@ -6725,6 +6725,10 @@ code { .page-header h1 { margin-top: 0px; } +/* To be applied to the same element as page-header for sites that have sub-heading content such as Last modified time */ +.page-header .sub-heading { + padding: 0px, 0px, 20px; +} pre { border: none; background-color: #8acc37; diff --git a/css/daux-navy.css b/css/daux-navy.css index 90a7466..c95a02a 100644 --- a/css/daux-navy.css +++ b/css/daux-navy.css @@ -6725,6 +6725,10 @@ code { .page-header h1 { margin-top: 0px; } +/* To be applied to the same element as page-header for sites that have sub-heading content such as Last modified time */ +.page-header .sub-heading { + padding: 0px, 0px, 20px; +} pre { border: none; background-color: #7795b4; diff --git a/css/daux-red.css b/css/daux-red.css index 9187ad0..6049831 100644 --- a/css/daux-red.css +++ b/css/daux-red.css @@ -6725,6 +6725,10 @@ code { .page-header h1 { margin-top: 0px; } +/* To be applied to the same element as page-header for sites that have sub-heading content such as Last modified time */ +.page-header .sub-heading { + padding: 0px, 0px, 20px; +} pre { border: none; background-color: #ecb5a1; diff --git a/docs/config.json b/docs/config.json index c133ecf..3dbd75c 100644 --- a/docs/config.json +++ b/docs/config.json @@ -3,6 +3,7 @@ "tagline": "The Easiest Way To Document Your Project", "image": "img/app.png", "theme": "navy", + "date_modified": true, "repo": "justinwalsh/daux.io", "twitter": ["justin_walsh", "todaymade"], "google_analytics": "UA-12653604-10", diff --git a/index.php b/index.php index 41d0c75..f9d660d 100644 --- a/index.php +++ b/index.php @@ -70,6 +70,8 @@ $tree = get_tree("docs", $base_url); $homepage_url = homepage_url($tree); $docs_url = docs_url($tree); +$page = load_page($tree); + // If a timezone has been set in the config file, override the default PHP timezone for this application. if(isset($options['timezone'])) { @@ -183,7 +185,24 @@ if ($homepage && $homepage_url !== '/') {
- + + + + + + + +
@@ -265,7 +284,23 @@ if ($homepage && $homepage_url !== '/') {
- + + + + + + +
diff --git a/less/import/daux-base.less b/less/import/daux-base.less index 6d2faa6..58e9555 100644 --- a/less/import/daux-base.less +++ b/less/import/daux-base.less @@ -478,6 +478,9 @@ code { h1 { margin-top: 0px; } + sub-heading { + padding: 0px, 0px, 20px; + } } pre { border: none; diff --git a/libs/functions.php b/libs/functions.php index f2856a1..a036322 100644 --- a/libs/functions.php +++ b/libs/functions.php @@ -34,6 +34,7 @@ function get_options() { 'tagline' => false, 'image' => false, 'theme' => 'blue', + 'date_modified' => true, 'float' => true, 'repo' => false, 'twitter' => array(), @@ -101,28 +102,29 @@ function docs_url($tree, $branch = false) { function load_page($tree) { $branch = find_branch($tree); + $page = array(); + if (isset($branch['type']) && $branch['type'] == 'file') { $html = ''; if ($branch['name'] !== 'index') { - $html .= ''; + $page['title'] = $branch['title']; + $page['modified'] = filemtime($branch['path']); } $html .= MarkdownExtended(file_get_contents($branch['path'])); - return $html; + + $page['html'] = $html; + } else { - return "Oh No. That page dosn't exist"; + + $page['title'] = "Oh no"; + $page['html'] = "

Oh No. That page dosn't exist

"; + } + + + return $page; } function find_branch($tree) {