From 67dea0c68a3983d64dbd26253c2db136b95069f5 Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com>
Date: Tue, 29 Nov 2016 20:50:15 -0500
Subject: [PATCH] Made the title and description in the header dynamic.

---
 config.rb               | 10 +++++++++-
 source/index.html.haml  |  2 ++
 source/layout.html.haml |  3 ++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/config.rb b/config.rb
index b9676ff..e18c81c 100644
--- a/config.rb
+++ b/config.rb
@@ -100,10 +100,18 @@ helpers do
     end
     
     def page_title
-        if current_page.data.title.present?
+        if current_page.data.header_title.present?
+            current_page.data.header_title
+        elsif current_page.data.title.present?
             current_page.data.title
         end
     end
+
+    def page_description
+        if current_page.data.description.present?
+            current_page.data.description
+        end
+    end
 end
 
 # Add bower's directory to sprockets asset path
diff --git a/source/index.html.haml b/source/index.html.haml
index 6e2455c..984c8a5 100644
--- a/source/index.html.haml
+++ b/source/index.html.haml
@@ -1,5 +1,7 @@
 ---
 title: Overview
+header_title: Aparapi
+description: Open-source framework for executing native Java code on the GPU.
 ---
 - content_for :additional_header do
   .row.center
diff --git a/source/layout.html.haml b/source/layout.html.haml
index 4f57734..4a157d6 100644
--- a/source/layout.html.haml
+++ b/source/layout.html.haml
@@ -40,7 +40,8 @@
         .container
           %h1.header.center-on-small-only #{page_title}
           .row.center
-            %h4.header.col.s12.light.center Open-source framework for executing native Java code on the GPU.
+            - if page_description
+              %h4.header.col.s12.light.center #{page_description}
           = yield_content(:additional_header) if content_for?(:additional_header)
         = yield_content(:banner) if content_for?(:banner)
       .container
-- 
GitLab