From 3e5656d31a3b9dd1bacd2892cb081ee8f554a6ec Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Fri, 25 Jan 2019 16:31:30 +0100
Subject: [PATCH] Better articles presentation

---
 article.php        | 10 +++++-----
 css/style.css      | 17 +++++------------
 posts.php          | 17 +++++------------
 single_article.php | 14 +++++++++-----
 4 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/article.php b/article.php
index 72c9ae1..f687936 100644
--- a/article.php
+++ b/article.php
@@ -1,13 +1,13 @@
 <?php theme_include('header'); ?>
 		<section class="content wrap" id="article-<?php echo article_id(); ?>">
-        <div class="row">
-         <div class="col-md-6 col-sd-12">
+        <div class="row" style="padding:70px">
+         <div class="col-md-4 col-sd-12">
 			<?php echo article_img(article_slug());?>
         </div>
-        <div class="col-md-6 col-sd-12">
-            <h1>
+        <div class="col-md-8 col-sd-12">
+            <h2>
             <?php echo article_title(); ?>
-            </h1>
+            </h2>
         </div>
         </div>
 			<article>
diff --git a/css/style.css b/css/style.css
index e94177d..0d249bb 100644
--- a/css/style.css
+++ b/css/style.css
@@ -21,6 +21,7 @@ h2{
 	padding: 20px 35px;
     margin: 20px;
 	background: #fff;
+    border-bottom: 1px solid rgba(22,54,36,.1);
 }
 	#top a {
 		float: left;
@@ -31,7 +32,7 @@ h2{
 
 		color: #88a795;
 	}
-		#top #logo:hover, #top ul a:hover, #top ul .active a, .posts .items li:first-child h2 a:hover, p a:hover {
+		#top #logo:hover, #top ul a:hover, #top ul .active a, .posts .items li h2 a:hover, p a:hover {
 			color: #41b171;
 		}
 	#top ul {
@@ -73,19 +74,11 @@ h2{
 	list-style: none;
 }
 	.items > li {
-		padding: 70px 0 60px;
-        border-bottom: 1px solid;
-
+		padding: 50px 0 50px;
+        border-top: 1px solid;
 		#color: #97c9ae;
 		#background: #3c4552;
 	}
-		.posts .items > li:first-child {
-			#background: #fff !important;
-			padding: 110px 0;
-		}
-			.items li h1 a, .posts .items > li:first-child h2 a {
-				color: #3d5145;
-			}
 	.items h1 {
 		padding: 0 0 8px;
 	}
@@ -101,7 +94,7 @@ h2{
 			padding-bottom: 12px;
 
 			color: #fff;
-			color: rgba(176,236,200,.8);
+            color: #3d5145;
 
 			text-decoration: none;
 		}
diff --git a/posts.php b/posts.php
index acbb743..9c318c5 100644
--- a/posts.php
+++ b/posts.php
@@ -2,29 +2,22 @@
 
 <section class="content">
     <?php
-        $title="Blog";
+        $title="";
         $text="";
         if (preg_match('/category.*/',current_url())){
             echo "<p id='".current_url()."'></p>";
             while(categories()){
                 echo "<p id='".category_url()."'></p>";
                 if(category_url() == "/".current_url()){
-                    $title.=" - ".category_title();
-                    $text="<div class='wrap'><p>".category_description()."</p>";
-                    $text.="<p>Cette catégorie regroupe ".category_count()." ".pluralise(category_count(), "article", "s")."</p></div>";
+                    $title.="".category_title();
+                    $text=' <span style="font-size:large"> - '.category_description()."</span>";
                 }
             }
+            echo '<h1 >'.$title.$text."</h1>\n";
         }
-        echo "<h1 style='text-align:center'>$title</h1>\n";
-        echo $text;
     ?>
 	<?php if(has_posts()): ?>
-            <?php posts(); ?>
-                <h2> Dernier article </h2>
-                <?php include("single_article.php"); ?>
-
-            <?php if(total_posts() > 1 || $title=="Blog"):?>
-                    <h2> Articles précédents </h2>
+            <?php if(total_posts() > 0 || $title==""):?>
 		            <ul class="items">
                 <?php $i = 0; while(posts()): ?>
                     <li >
diff --git a/single_article.php b/single_article.php
index 0aaf64f..bddf748 100644
--- a/single_article.php
+++ b/single_article.php
@@ -2,6 +2,15 @@
     <div class="row">
          <div class="col-md-6 col-sd-12">
             <a href="<?php echo article_url(); ?>" title="<?php echo article_title(); ?>"><?php echo article_img(article_slug());?></a>
+    <div style="font-size:small;padding-top:15px">
+        <p>Article num&eacute;ro: <?php echo article_number(article_id()); ?>, <?php echo count_words(article_markdown()); ?> mots <?php if(comments_open()): ?>,
+        <?php echo total_comments();?> <?php echo pluralise(total_comments(), "commentaire", "s") ?>.<?php endif; ?> <?php echo article_custom_field('attribution'); ?><br />
+        Posté <time datetime="<?php echo date(DATE_W3C, article_time()); ?>"><?php echo relative_time(article_time()); ?></time> par <?php echo article_author('real_name'); ?>.
+</p>
+    </div>
+
+
+
         </div>
         <div class="col-md-6 col-sd-12">
             <h2 style="padding:0px">
@@ -11,10 +20,5 @@
             <?php echo article_description(); ?>
         </div>
     </div>
-    <footer>
-        <p>Article num&eacute;ro: <?php echo article_number(article_id()); ?>, <?php echo count_words(article_markdown()); ?> mots <?php if(comments_open()): ?>,
-        <?php echo total_comments();?> <?php echo pluralise(total_comments(), "commentaire", "s") ?>.<?php endif; ?> <?php echo article_custom_field('attribution'); ?></p>
-        Posté <time datetime="<?php echo date(DATE_W3C, article_time()); ?>"><?php echo relative_time(article_time()); ?></time> par <?php echo article_author('real_name'); ?>.
-    </footer>
 </article>
 
-- 
GitLab