You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/03/13 13:33:48 UTC

[GitHub] [camel-website] avgupt opened a new pull request #210: Feature Avatar on Blog Posts

avgupt opened a new pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210
 
 
   @zregvart I was not sure how to import avatar images, so I used a default image for now. Can you please help me with that?
   Also, here's a screenshot of how it looks now.
   ![image](https://user-images.githubusercontent.com/58681517/76625481-57f10a80-655d-11ea-8a61-6728149af97b.png)
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on issue #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on issue #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#issuecomment-598724831
 
 
   @avgupt the [issue](https://issues.apache.org/jira/browse/CAMEL-14675) mentions using avatar pictures from GitHub or from Gravatar.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r392233002
 
 

 ##########
 File path: antora-ui-camel/src/css/doc.css
 ##########
 @@ -634,3 +634,15 @@ kbd,
 .stretch {
   width: 100%;
 }
+
+.avatar {
+  vertical-align: middle;
+  width: 100px;
+  height: 100px;
+  border-radius: 50%;
+}
+
+#publishDate {
+  position: relative;
+  bottom: 35px;
 
 Review comment:
   Any changes to the design of the blog need to go to `blog.css`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] avgupt commented on issue #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
avgupt commented on issue #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#issuecomment-601307983
 
 
   @zregvart Thanks for the review! I have made the suggested changes. Please have a look.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] avgupt commented on issue #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
avgupt commented on issue #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#issuecomment-598784463
 
 
   @zregvart Thanks for the help! I have made some changes, adding front matter attribute `github_handle` to the blog posts would be enough to show the corresponding avatar. (Provided accessing GitHub is allowed by the website content security policy).
   It's working perfectly on my local machine though.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] avgupt commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
avgupt commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r395191666
 
 

 ##########
 File path: antora-ui-camel/src/css/blog.css
 ##########
 @@ -119,6 +119,24 @@ article.blog p {
   background: var(--color-smoke-90);
 }
 
+.avatar {
+  vertical-align: middle;
+  width: 100px;
+  height: 100px;
+  border-radius: 50%;
+}
+
+#publishDate {
+  position: relative;
+  bottom: 35px;
+}
+
+.date-and-name {
+  position: relative;
+  bottom: 105px;
+  left: 110px;
+}
+
 
 Review comment:
   Replaced `px` with `em`.
   Removed id-based rules and scoped the rules to .blog

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r398515667
 
 

 ##########
 File path: antora-ui-camel/src/css/blog.css
 ##########
 @@ -119,6 +119,24 @@ article.blog p {
   background: var(--color-smoke-90);
 }
 
+.blog .avatar {
+  vertical-align: middle;
+  width: 100px;
+  height: 100px;
 
 Review comment:
   I'd use `rem` or `vh` here, fix pixel sizes are a problem when user chooses to increase/decrease text size in their browser and on different screen sizes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] avgupt removed a comment on issue #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
avgupt removed a comment on issue #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#issuecomment-602699991
 
 
   @zregvart Kind reminder. :)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] avgupt commented on issue #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
avgupt commented on issue #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#issuecomment-603346402
 
 
   @zregvart @oscerd Any suggestions?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r392679977
 
 

 ##########
 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 }}
 
 Review comment:
   Not sure there's a need for the `with` block here, it encompasses only one element

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r398517122
 
 

 ##########
 File path: antora-ui-camel/src/img/avatar.svg
 ##########
 @@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 
 Review comment:
   Did you create this image, if are we free to use it without attribution, i.e. what's the license?
   
   This also needs to be optimized you can use [svgomg](https://jakearchibald.github.io/svgomg/)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart closed pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart closed pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r398515748
 
 

 ##########
 File path: antora-ui-camel/src/css/blog.css
 ##########
 @@ -119,6 +119,24 @@ article.blog p {
   background: var(--color-smoke-90);
 }
 
+.blog .avatar {
+  vertical-align: middle;
+  width: 100px;
+  height: 100px;
+  border-radius: 50%;
+}
+
+.blog .date-and-name {
+  position: relative;
+  bottom: 6em;
+  left: 7em;
 
 Review comment:
   Use relative units.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] avgupt commented on issue #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
avgupt commented on issue #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#issuecomment-598742500
 
 
   > @avgupt the [issue](https://issues.apache.org/jira/browse/CAMEL-14675) mentions using avatar pictures from GitHub or from Gravatar.
   
   @zregvart Can you please help me in linking users to their GitHub images? Will it require changes in the camel repo?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] avgupt commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
avgupt commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r400134906
 
 

 ##########
 File path: antora-ui-camel/src/img/avatar.svg
 ##########
 @@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 
 Review comment:
   I took the image from here: https://en.m.wikipedia.org/wiki/File:Missing_avatar.svg
   Can I go ahead and optimze it?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] avgupt commented on issue #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
avgupt commented on issue #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#issuecomment-602699991
 
 
   @zregvart Kind reminder. :)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r392679542
 
 

 ##########
 File path: antora-ui-camel/src/css/blog.css
 ##########
 @@ -119,6 +119,24 @@ article.blog p {
   background: var(--color-smoke-90);
 }
 
+.avatar {
+  vertical-align: middle;
+  width: 100px;
+  height: 100px;
+  border-radius: 50%;
+}
+
+#publishDate {
+  position: relative;
+  bottom: 35px;
+}
+
+.date-and-name {
+  position: relative;
+  bottom: 105px;
+  left: 110px;
+}
+
 
 Review comment:
   - These rules need to be scoped to `.blog`, as all other rules in this file are.
   - Don't use `px`, we exclusively use relative lengths
   - Don't use id-based rules for elements that could occur more than once

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r392233292
 
 

 ##########
 File path: layouts/blog/post.html
 ##########
 @@ -9,8 +9,15 @@ <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>
+            <table>
+                <tr>
+                    <td rowspan="2"> <img src="https://www.w3schools.com/howto/img_avatar.png" alt="Avatar" class="avatar"> </td>
+                    <td><p>by <span rel="author">{{ .Params.author }}</span></p></td>
+                </tr>
+                <tr id = "publishDate">
+                    <td><time itemprop="published" datetime="{{ dateFormat "2006-01-02" .PublishDate }}" title="{{ dateFormat "Monday, January 2, 2006" .PublishDate }}">{{ dateFormat "January 2, 2006" .PublishDate }}</time></td>
+                </tr>
+            </table>
 
 Review comment:
   We try to use semantic HTML, introducing tables for this is not the right approach.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r398524808
 
 

 ##########
 File path: layouts/blog/post.html
 ##########
 @@ -9,8 +9,22 @@ <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">
+                {{ $avatar := newScratch }}
+                {{ $avatar.Set "url" "_/img/avatar.svg" }}
+
+                {{ if .Params.github_user }}
+                    {{ $userData := getJSON "https://api.github.com/users/" .Params.github_user }}
+                    {{ $avatar.Set "url" $userData.avatar_url }}
+                {{ end }}
+                    <div class="post-avatar">
+                            <img src="{{ $avatar.Get "url" | relURL }}" class="avatar">
+                    </div>
 
 Review comment:
   I would do this without the scratch and without as many divs, like (haven't tested):
   
   ```suggestion
                   {{ if .Params.github_user }}
                       {{ $userData := getJSON "https://api.github.com/users/" .Params.github_user }}
                       <img src="{{ $userData.avatar_url }}" class="avatar" alt="{{ .Params.author }}">
                   {{ else }}
                       <img src="{{ "/_/img/avatar.svg" | relURL }} " class="avatar" alt="{{ .Params.author }}">
                   {{ end }}
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r398515808
 
 

 ##########
 File path: antora-ui-camel/src/css/blog.css
 ##########
 @@ -119,6 +119,24 @@ article.blog p {
   background: var(--color-smoke-90);
 }
 
+.blog .avatar {
+  vertical-align: middle;
+  width: 100px;
+  height: 100px;
+  border-radius: 50%;
+}
+
+.blog .date-and-name {
+  position: relative;
+  bottom: 6em;
+  left: 7em;
+}
+
+.blog .publish-date {
+  position: relative;
+  bottom: 2em;
 
 Review comment:
   Use `rem` instead

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on issue #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on issue #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#issuecomment-607202228
 
 
   This was used to further develop this feature in ac458a0f1f2a5f28e62a208f7460c7e757e1a0a1 84bcfe5d870930f25d5a0945026628a4541f642e a4c4cb74b7d7388fdcf0f9ce7b1faca67aead2f2 4f021ae6b6ff3a2b7dc100edad8357ac8802823c and e3671bfab39a7142a81c5e9d3e5fe6945b8f6200

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r392679940
 
 

 ##########
 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 }}
 
 Review comment:
   No need for `$urlPre` variable. Use better and more descriptive variable names than `$urlPre` and `$gist`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on a change in pull request #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#discussion_r400480592
 
 

 ##########
 File path: layouts/blog/post.html
 ##########
 @@ -9,8 +9,18 @@ <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_user }}
+                    {{ $userData := getJSON "https://api.github.com/users/" .Params.github_user }}
+                    <img src="{{ $userData.avatar_url }}" class="avatar" alt="{{ .Params.author }}">
+                {{ else }}
+                    <img src="{{ "/_/img/avatar.svg" | relURL }} " class="avatar" alt="{{ .Params.author }}">
+                {{ end }}
+                <div class="date-and-name">
+                    <p>by <span rel="author">{{ .Params.author }}</span></p>
 
 Review comment:
   This bit changed in #292 to allow multiple authors on a blog post, can we make the same change here and in the `github_user` parameter?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on issue #210: Feature Avatar on Blog Posts

Posted by GitBox <gi...@apache.org>.
zregvart commented on issue #210: Feature Avatar on Blog Posts
URL: https://github.com/apache/camel-website/pull/210#issuecomment-598759015
 
 
   @avgupt look into GitHub developer documentation, there is an API to [fetch user details](https://developer.github.com/v3/users/#get-a-single-user) that includes the avatar image of the user. As the issue mentions this can be done using Hugo data templates. I think the change we need besides in the layouts and CSS is that for each blog post we need to add additional front matter attribute to hold the authors github username.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services