]> _ Git - fluidbook-v3.git/commitdiff
Microdata, SEO and styling adjustments. WIP #3641 @3.5
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 2 Jun 2020 10:24:40 +0000 (10:24 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 2 Jun 2020 10:24:40 +0000 (10:24 +0000)
framework/application/configs/application.ini
framework/application/views/helpers/BlogBody.php
framework/application/views/helpers/BlogIndex.php
framework/application/views/helpers/BlogIntro.php
framework/application/views/scripts/blogpost/index.phtml
less/610-blog.less

index fb20317b995851f7f851e68d9321633301e5b1df..a65983430df19b3a3624b864982a844bf2c76b11 100644 (file)
@@ -70,9 +70,9 @@ privacy.analytics = 1
 [testing : production]
 
 dev = true
-firephp = true
+firephp = false
 
-minify.js = false
+;minify.js = false
 
 seo.universalAnalytics = UA-4339912-9
 
index 6dcdb087188b0c19794702926e6de66f3c38c604..7f04901ad6836bf1a5bca5ddc9a766ceddbdf0bf 100644 (file)
@@ -4,8 +4,8 @@ class Fluidbook_View_Helper_BlogBody extends CubeIT_View_Helper_Abstract {
 
     public function blogBody(Fluidbook_Model_Blog $post) {
 
-        $res  = '<div class="content-wrapper grid">';
-        $res .= '<div class="blog-post-body">';
+        $res  = '<section class="content-wrapper grid">';
+        $res .= '<div class="blog-post-body" itemprop="articleBody">';
 
         foreach ($post->getContent() as $content) {
 
@@ -26,7 +26,7 @@ class Fluidbook_View_Helper_BlogBody extends CubeIT_View_Helper_Abstract {
 
         // Author details
         $photo = $this->imageProcess()->imageProcessGetUrl($this->author->getPhoto(), null, 120, 120);
-        $res .= '<div class="blog-author" itemscope itemtype="http://schema.org/Person">';
+        $res .= '<div class="blog-author" itemprop="author" itemscope itemtype="http://schema.org/Person">';
         $res .= '<div class="blog-author-photo" itemprop="image" style="background-image:url('. $photo .');"></div>';
         $res .= '<div class="blog-author-details">';
         $res .= '<h3 class="blog-author-name" itemprop="name">'. $this->author->getName() .'</h3>';
@@ -39,7 +39,7 @@ class Fluidbook_View_Helper_BlogBody extends CubeIT_View_Helper_Abstract {
         $res .= '</div>'; // .blog-author
 
         $res .= '</div>'; // .blog-post-body
-        $res .= '</div>'; // .content-wrapper
+        $res .= '</section>'; // .content-wrapper
 
         return $res;
     }
index c24ec0d502c8fe6cd95053f721fd1d7529280bd5..be14112220d0ad8ed977141c6a4792be6c6207b8 100644 (file)
@@ -20,7 +20,7 @@ class Fluidbook_View_Helper_BlogIndex extends CubeIT_View_Helper_Abstract {
 \r
         foreach ($posts as $post) {\r
             /* @var $post Fluidbook_Model_Blog */\r
-            $res .= $this->htmlElement($this->blogIntro($post, false), 'article', ['itemProp' => 'blogPost']);\r
+            $res .= $this->htmlElement($this->blogIntro($post, false), 'article', ['itemscope' => null, 'itemtype' => 'http://schema.org/Article']);\r
         }\r
 \r
         return $this->htmlElement($res, 'div', ['class' => 'blog-index']);\r
index d115af16bd50962ecd10cea928657085ce2bd780..aae2e189b9c9ade2776946d0a42837a681f1c14c 100644 (file)
@@ -15,7 +15,7 @@ class Fluidbook_View_Helper_BlogIntro extends CubeIT_View_Helper_Abstract {
             $title = $post->getTitle();
             $title_tag = 'h1';
         } else {
-            $title = $this->link($post->getTitle(), $URL);
+            $title = $this->link($post->getTitle(), $URL, ['itemprop' => 'url']);
             $title_tag = 'h2';
         }
 
@@ -28,9 +28,13 @@ class Fluidbook_View_Helper_BlogIntro extends CubeIT_View_Helper_Abstract {
         $res .= $this->dateTime(
             $post->getPublishDate(),
             CubeIT_Date::DAY .' '. CubeIT_Date::MONTH_NAME .' '. CubeIT_Date::YEAR,
-            ['class' => 'blog-intro-date']
+            [
+                'class' => 'blog-intro-date',
+                'datetime' => $post->getPublishDate()->toString(Zend_Date::ISO_8601),
+                'itemprop' => 'datePublished',
+            ]
         );
-        $res .= $this->title($title, $title_tag, ['class' => 'blog-intro-title']);
+        $res .= $this->title($title, $title_tag, ['class' => 'blog-intro-title', 'itemprop' => 'headline']);
         $res .= $this->markupDotclear($post->getExcerpt(), [], ['class' => 'blog-intro-excerpt']);
         $res .= '</div>'; // .col-2
         $res .= '</div>'; // .grid
index bc694b429a92dcba8d30e03236ed1ed526064c76..a50c38f89f6a02990dfc91534989f03794cefe81 100644 (file)
@@ -5,7 +5,10 @@ $attributes = [
         'data-header-theme' => $this->post->getIntroStyle(),
 ];
 
+echo '<article itemscope itemtype="http://schema.org/Article">';
 echo $this->htmlElement($this->blogIntro($this->post), 'section', $attributes);
 echo $this->blogBody($this->post);
+echo '</article>';
+
 echo $this->contactFooter();
 
index 88f833db4464ceb40158722c5414d453c057dcc1..174b7d2f3eda2e94efb1a6bd7a91515fd9d48953 100644 (file)
   align-items: center;
 
   // Extra padding to ensure text doesn't get too close to edges or overlap when under a header
-  // Padding is symmetrical so that vertical centre is not thrown off
+  // Padding is symmetrical so that vertical centre is not thrown off. However, on smaller screens this is not relevant.
   padding: 144px 0 !important;
 
   @media @m1280 {
-    padding: 86px 0 !important;
+    padding: 106px 0 66px !important;
   }
   @media @m900 {
-    padding: 96px 0 !important;
+    padding: 116px 0 76px !important;
   }
   @media @m768 {
-    padding: 75px 0 !important;
+    padding: 95px 0 55px !important;
   }
 
   @media @m1024 {
   max-width: 1008px;
   width: 100%;
 
+  @media @m1280 {
+    font-size: 22px;
+  }
   @media @m1024 {
     font-size: 20px;
   }