From 92f2408deb674e2dcbeea68ff414818ec8daa99f Mon Sep 17 00:00:00 2001
From: Markus Birth <mbirth@gmail.com>
Date: Fri, 20 May 2016 13:19:03 +0200
Subject: [PATCH] Moved mustache partials to separate directory.

---
 index.php                                                       | 1 +
 templates/index_html.mustache                                   | 1 +
 templates/{ => partials}/html_foot.mustache                     | 0
 templates/{ => partials}/html_head.mustache                     | 0
 .../{mdl_foot.mustache => partials/mdl_content_foot.mustache}   | 2 --
 templates/{ => partials}/mdl_content_head.mustache              | 1 -
 templates/partials/mdl_foot.mustache                            | 2 ++
 templates/{ => partials}/mdl_head.mustache                      | 1 +
 8 files changed, 5 insertions(+), 3 deletions(-)
 rename templates/{ => partials}/html_foot.mustache (100%)
 rename templates/{ => partials}/html_head.mustache (100%)
 rename templates/{mdl_foot.mustache => partials/mdl_content_foot.mustache} (95%)
 rename templates/{ => partials}/mdl_content_head.mustache (84%)
 create mode 100644 templates/partials/mdl_foot.mustache
 rename templates/{ => partials}/mdl_head.mustache (89%)

diff --git a/index.php b/index.php
index 6d79036..5f263f2 100644
--- a/index.php
+++ b/index.php
@@ -4,6 +4,7 @@ require_once __DIR__ . '/vendor' . '/autoload.php';
 
 $m = new Mustache_Engine(array(
     'loader' => new Mustache_Loader_FilesystemLoader(dirname(__FILE__) . '/templates'),
+    'partials_loader' => new Mustache_Loader_FilesystemLoader(dirname(__FILE__) . '/templates/partials'),
     'charset' => 'utf-8',
     'logger' => new Mustache_Logger_StreamLogger('php://stderr'),
 ));
diff --git a/templates/index_html.mustache b/templates/index_html.mustache
index 9ae20ee..c133ea7 100644
--- a/templates/index_html.mustache
+++ b/templates/index_html.mustache
@@ -201,6 +201,7 @@
             Hello, world!
 </p>
 
+{{> mdl_content_foot}}
 {{> mdl_foot}}
 <a href="https://github.com/google/material-design-lite/blob/master/templates/article/" target="_blank" id="view-source" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-color--accent mdl-color-text--accent-contrast">View Source</a>
 {{> html_foot}}
diff --git a/templates/html_foot.mustache b/templates/partials/html_foot.mustache
similarity index 100%
rename from templates/html_foot.mustache
rename to templates/partials/html_foot.mustache
diff --git a/templates/html_head.mustache b/templates/partials/html_head.mustache
similarity index 100%
rename from templates/html_head.mustache
rename to templates/partials/html_head.mustache
diff --git a/templates/mdl_foot.mustache b/templates/partials/mdl_content_foot.mustache
similarity index 95%
rename from templates/mdl_foot.mustache
rename to templates/partials/mdl_content_foot.mustache
index 908d801..01c7101 100644
--- a/templates/mdl_foot.mustache
+++ b/templates/partials/mdl_content_foot.mustache
@@ -9,5 +9,3 @@
         </ul>
       </div>
     </footer>
-  </main>
-</div>
diff --git a/templates/mdl_content_head.mustache b/templates/partials/mdl_content_head.mustache
similarity index 84%
rename from templates/mdl_content_head.mustache
rename to templates/partials/mdl_content_head.mustache
index dcceaab..99d5caf 100644
--- a/templates/mdl_content_head.mustache
+++ b/templates/partials/mdl_content_head.mustache
@@ -1,4 +1,3 @@
-  <main class="frs-main mdl-layout__content">
     <div class="frs-container mdl-grid">
       <div class="mdl-cell mdl-cell--2-col mdl-cell--hide-tablet mdl-cell--hide-phone"></div>
       <div class="frs-content mdl-color--white mdl-shadow--4dp content mdl-color-text--grey-800 mdl-cell mdl-cell--8-col">
diff --git a/templates/partials/mdl_foot.mustache b/templates/partials/mdl_foot.mustache
new file mode 100644
index 0000000..e09d289
--- /dev/null
+++ b/templates/partials/mdl_foot.mustache
@@ -0,0 +1,2 @@
+  </main>
+</div>
diff --git a/templates/mdl_head.mustache b/templates/partials/mdl_head.mustache
similarity index 89%
rename from templates/mdl_head.mustache
rename to templates/partials/mdl_head.mustache
index ee0befa..3a317d9 100644
--- a/templates/mdl_head.mustache
+++ b/templates/partials/mdl_head.mustache
@@ -5,3 +5,4 @@
     </div>
   </header>
   <div class="frs-ribbon"></div>
+  <main class="frs-main mdl-layout__content">