zregvart commented on a change in pull request #210: Feature Avatar on Blog 
Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r392679703
 
 

 ##########
 File path: layouts/blog/post.html
 ##########
 @@ -9,8 +9,24 @@ <h1><a href="{{.Page.Permalink}}">{{ .Title }}</a></h1>
     <div class="post">
         <aside>
             <div class="summary">{{ .Params.preview }}</div>
-            <time itemprop="published" datetime="{{ dateFormat "2006-01-02" 
.PublishDate }}" title="{{ dateFormat "Monday, January 2, 2006" .PublishDate 
}}">{{ dateFormat "January 2, 2006" .PublishDate }}</time>
-            <p>by <span rel="author">{{ .Params.author }}</span></p>
+            <div class="info">
+                {{ if .Params.github_handle }}
+                    <div class="post-avatar">
+                        {{ $urlPre := "https://api.github.com"; }}
+                        {{ $gist := getJSON $urlPre "/users/" 
.Params.github_handle }}
+                        {{ with $gist }}
+                            <img src="{{ .avatar_url }}" alt="Avatar" 
class="avatar">
+                        {{ end }}
+                    </div>
+                <div class="date-and-name">
+                    <p>by <span rel="author">{{ .Params.author }}</span></p>
+                    <time itemprop="published" datetime="{{ dateFormat 
"2006-01-02" .PublishDate }}" title="{{ dateFormat "Monday, January 2, 2006" 
.PublishDate }}">{{ dateFormat "January 2, 2006" .PublishDate }}</time>
+                </div>
+                {{ else }}
+                    <time itemprop="published" datetime="{{ dateFormat 
"2006-01-02" .PublishDate }}" title="{{ dateFormat "Monday, January 2, 2006" 
.PublishDate }}">{{ dateFormat "January 2, 2006" .PublishDate }}</time>
+                    <p>by <span rel="author">{{ .Params.author }}</span></p>
+                {{ end }}
 
 Review comment:
   These two blocks are almost identical, don't duplicate markup makes it more 
difficult to maintain. No need to reorder elements with modern CSS such as flex 
layout

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to