Skip to content

Commit

Permalink
Merge pull request #1168 from oleg-nenashev/author-profile-boxes
Browse files Browse the repository at this point in the history
[INFRA-1359] - Add Author Info  boxes to blog-posts
  • Loading branch information
bitwiseman committed Dec 1, 2017
2 parents 1885885 + e3f4152 commit 5e5645d
Show file tree
Hide file tree
Showing 13 changed files with 222 additions and 22 deletions.
5 changes: 5 additions & 0 deletions content/_data/authors/alyssat.adoc
Expand Up @@ -2,3 +2,8 @@
name: "Alyssa Tong"
github: alyssat
---

Jenkins Event Officer.
Alyssa runs
the link:/projects/jam[Jenkins Area Meetup] program and is also responsible for
Marketing & Community Programs at link:http://cloudbees.com[CloudBees, Inc.]
7 changes: 3 additions & 4 deletions content/_data/authors/bvdawson.adoc
Expand Up @@ -3,7 +3,6 @@ name: "Brian Dawson"
twitter: brianvdawson
github: bvdawson
---
DevOps dude at CloudBees
Jenkins Marketing Manager
Tools geek
---
DevOps dude at CloudBees.
Jenkins Marketing Manager.
Tools geek.
1 change: 0 additions & 1 deletion content/_data/authors/michaelneale.adoc
Expand Up @@ -8,4 +8,3 @@ Michael is a CD enthusiast with a interest in User Experience.
He is a co-founder of CloudBees and a long time OSS developer, and can often be found
lurking around the jenkins-dev mailing list or #jenkins on irc (same nick as twitter name).
Before CloudBees he worked at Red Hat.
---
11 changes: 11 additions & 0 deletions content/_data/authors/oleg_nenashev.adoc
Expand Up @@ -3,3 +3,14 @@ name: Oleg Nenashev
twitter: oleg_nenashev
github: "oleg-nenashev"
---

Oleg an active Jenkins contributor and engineer at CloudBees.
He has a PhD degree in Hardware Engineering and >10 years in R&D and Automation.
Oleg contributes to the Jenkins core,
maintains link:/projects/remoting[Remoting] and plugins like
link:https://plugins.jenkins.io/role-strategy[Role Strategy],
link:https://plugins.jenkins.io/envinject[EnvInject],
link:https://plugins.jenkins.io/ownership[Ownership],
etc.
He also organizes link:/projects/jam/[Jenkins meetups]
and events like link:/projects/gsoc[GSoC].
1 change: 0 additions & 1 deletion content/_data/authors/omehegan.adoc
Expand Up @@ -5,4 +5,3 @@ github: omehegan
---

Owen has been using and administering Jenkins for software companies since 2009 (when it was known as Hudson). He can play the guitar, he knows Morse code, and he has sometimes been known to rebuild two-stroke engines successfully on the first try.
---
2 changes: 1 addition & 1 deletion content/_data/authors/rtyler.adoc
Expand Up @@ -5,7 +5,7 @@ github: rtyler
blog: 'http://unethicalblogger.com'
---

R\. Tyler Croy has been part of the Jenkins project for the past seven years.
R. Tyler Croy has been part of the Jenkins project for the past seven years.
While avoiding contributing any Java code, Tyler is involved in many of the
other aspects of the project which keep it running, such as this website,
infrastructure, governance, etc.
1 change: 0 additions & 1 deletion content/_data/authors/vgaidarji.adoc
Expand Up @@ -8,5 +8,4 @@ blog: 'http://vgaidarji.me'
Veaceslav is a software developer with the main focus on Android platform.
In his free time, he enjoys working on different open-source projects.

---

28 changes: 15 additions & 13 deletions content/_ext/authorship.rb
Expand Up @@ -11,28 +11,30 @@ module Authorship
[:blog, 'VALUE'],
].freeze

def display_author_for(node)
def display_author_for(node, link = nil)
# bail early if what we were given doesn't even respond
return unless node.author

author = node.author.to_sym

if node.author && site.authors.has_key?(author)
full_name = site.authors[author].name
link = nil

# Let's find a nice link to give our author
AUTHOR_LINK_PREFERENCE.each do |link_type, url|
value = site.authors[author].send(link_type)
# If we didn't get anything, skip
next if value.nil?

link = url.gsub(/VALUE/, value.to_s)
break unless link.nil?
end

# If the caller provided a link use it, otherwise
if link.nil?
return full_name
# Let's find a nice link to give our author
AUTHOR_LINK_PREFERENCE.each do |link_type, url|
value = site.authors[author].send(link_type)
# If we didn't get anything, skip
next if value.nil?

link = url.gsub(/VALUE/, value.to_s)
break unless link.nil?
end

if link.nil?
return full_name
end
end

return "<a href=\"#{link}\">#{full_name}</a>"
Expand Down
3 changes: 2 additions & 1 deletion content/_layouts/post.html.haml
Expand Up @@ -29,7 +29,7 @@ layout: default
Published on
= page.date.strftime('%Y-%m-%d')
by
= display_author_for(page)
= display_author_for(page, "#about-the-author")
- if page.tags
%ul.list-inline.tags
- page.tags.each do |tag|
Expand All @@ -38,3 +38,4 @@ layout: default
= tag

= content
= partial("author.html.haml", :author => page.author)
39 changes: 39 additions & 0 deletions content/_partials/author.html.haml
@@ -0,0 +1,39 @@
- authorId = page.author || ''
- author = site.authors[authorId]

-if author
%div{:id => "about-the-author"}
%b.author.about-header
About the Author
%table.author.box
%tr
%td
- author.avatar = Dir.glob("content/images/avatars/#{authorId}.{bmp,gif,ico,jpg,jpeg,png,svg}").first
- if author.avatar
- author.avatar.sub!('content','')
%img.author.logo{:src => author.avatar, :alt => author.name}
- else
%img.author.logo{:src => "/images/logos/transparent/transparent.svg", :alt => author.name}
%td
%b.author.name
= author.name
%p
- if author.content.empty?
This author has no biography defined.
See social media links referenced below.
- else
= author.content
%ul.author.social-media-buttons
- if author.github
%li.author
%a{:href => "https://github.com/#{author.github}", :target => "_blank"}
GitHub
- if author.twitter
%li.author
%a{:href => "https://twitter.com/#{author.twitter}", :target => "_blank"}
Twitter
- if author.blog
%li.author
%a{:href => "#{author.blog}", :target => "_blank"}
Blog

39 changes: 39 additions & 0 deletions content/css/jenkins.css
Expand Up @@ -1670,3 +1670,42 @@ table.syntax > tbody > tr > th {
background-color: #069;
color: #fff;
}

.author.box td {
padding: 5px;
vertical-align: top;
max-width: 600px;
}

.author.box p {
margin-bottom: 3px;
}

/* Same as h3*/
.author.about-header {
font:1.5em Georgia, "Times New Roman";
margin-bottom:3px;
}

/* Same as h4 */
.author.name {
font:1.3em Georgia, "Times New Roman";
}

.author.logo {
height: 128px;
}

.author.social-media-buttons {
float: left;
list-style: none;
margin-top: 0px;
padding: 0;
width: 100%;
}

.author.social-media-buttons li {
display: block;
float: left;
margin-right: 10px;
}
Binary file added content/images/avatars/oleg_nenashev.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5e5645d

Please sign in to comment.