Skip to content

Commit ebd3898

Browse files
Add Author Profile sidebar (#21)
* Author Profile Sidebar added. * Created authors.yml to save author profiles. * Fixed the links in all posts. Co-authored-by: aashish-ak <[email protected]>
1 parent 2aead3c commit ebd3898

18 files changed

+759
-70
lines changed

.github/CONTRIBUTING.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,33 @@ git checkout -b branch-name
5555

5656
- Create a new file for your article/blog in the `_posts` folder. The format of your file should be like `yyyy-mm-dd-title-of-article.md`, following this naming convention is very important as jekyll would not be able to read your post otherwise.
5757

58-
- In your article/blog file, add the following jekyll-liquid header at the beginning of your file, which is required, without it jekyll would not be able to read your post.
58+
- If you're a frequent blogger, then add your profile in `_data/authors.yml` file and if you don't want to do that, add the following fields to the YAML frontmatter of the post.
59+
60+
```yaml
61+
---
62+
# Remove the ones which you don't want to keep.
63+
author_image_url: "https://example.com/author"
64+
author_bio: "Author Bio"
65+
author_linkedin_url: "https://linkedin.com/in/id"
66+
author_github_url: "https://github.com/id"
67+
author_facebook_url: "https://facebook.com/id"
68+
author_instagram_url: "https://instagram.com/id"
69+
author_twitter_url: "https://twitter.com/id"
70+
---
71+
```
72+
73+
- In your article/blog file, add the following YAML frontmatter in the beginning of your file, which is required, without it jekyll would not be able to read your post.
5974

6075
```bash
6176
---
6277
layout: post
63-
author: "<Your Name>"
64-
author_url: <Your github profile url>
78+
author: "<Your Name/ Github Username>" # If you've added your profile in authors.yml then only use github username
79+
author_github_id: <Your github username> # Remove this if you've already added your profile in authors.yml
80+
6581
title: "<Your article title>"
6682
subtitle: "<Your article subtitle (optional)>"
6783
bg_url: "<A relevant BG image url>"
68-
tags: [home]
69-
home_title: "<Simplified Title for homepage>"
70-
home_subtitle: "<Simplified subtitle for hompage>"
84+
tags: [<your custom tags>]
7185
---
7286
```
7387

_data/authors.yml

Lines changed: 90 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,107 @@
1-
Aashish Kumar:
1+
# github_id:
2+
# name : "Your Name"
3+
# bio : "Your Bio"
4+
# avatar : "Paste your DP link here"
5+
# links:
6+
# - label: "Email"
7+
# icon: "fas fa-fw fa-envelope-square"
8+
# url: "mailto:[email protected]"
9+
# - label: "Website"
10+
# icon: "fas fa-fw fa-link"
11+
# url: "https://www.yourwebsite.com"
12+
# - label: "GitHub"
13+
# icon: "fab fa-fw fa-github"
14+
# url: "https://github.com/yourgithub-id"
15+
# - label: "Linkedin"
16+
# icon: "fab fa-linkedin"
17+
# url: "https://www.linkedin.com/in/your-linkedin-username/"
18+
# - label: "Facebook"
19+
# icon: "fab fa-fw fa-facebook"
20+
# url: "https://facebook.com/your-facebook-username"
21+
# - label: "Instagram"
22+
# icon: "fab fa-fw fa-instagram"
23+
# url: "https://instagram.com/your-instagram-username"
24+
25+
aashish-ak:
226
name : "Aashish Kumar"
327
bio : "Core Team Member, Programming Club, IIT Mandi"
428
avatar : "https://avatars2.githubusercontent.com/u/21988675?s=400&v=4"
529
links:
630
- label: "Email"
7-
icon: "fas fa-fw fa-envelope-square"
31+
icon: "fas fa-envelope-square"
832
url: "mailto:[email protected]"
9-
- label: "Website"
10-
icon: "fas fa-fw fa-link"
11-
url: "https://aashish-ak.github.io"
33+
- label: "GitHub"
34+
icon: "fab fa-github"
35+
url: "https://github.com/aashish-ak"
1236
- label: "Linkedin"
1337
icon: "fab fa-linkedin"
14-
url: "https://www.linkedin.com/in/aashish-kumar-159715129/"
38+
url: "https://www.linkedin.com/in/aashish-ak"
39+
- label: "Instagram"
40+
icon: "fab fa-instagram"
41+
url: "https://instagram.com/main.whi.hoon"
42+
1543
DevBae:
1644
name : "DevBae"
1745
bio : "Admin, DevBae"
18-
avatar : "/assets/images/devbae_dp.png"
46+
avatar : "https://avatars2.githubusercontent.com/u/64611797"
1947
links:
2048
- label: "Email"
21-
icon: "fas fa-fw fa-envelope-square"
49+
icon: "fas fa-envelope-square"
2250
url: "mailto:[email protected]"
2351
- label: "Website"
2452
icon: "fas fa-fw fa-link"
2553
url: "https://devbae.tech"
54+
55+
the-utkarshjain:
56+
name : "Utkarsh Jain"
57+
bio : "Core Team Member, DevBae"
58+
avatar : "https://avatars3.githubusercontent.com/u/45516528?s=460v=4"
59+
links:
60+
- label: "Email"
61+
icon: "fas fa-envelope-square"
62+
url: "mailto:[email protected]"
63+
- label: "GitHub"
64+
icon: "fab fa-fw fa-github"
65+
url: "https://github.com/the-utkarshjain"
66+
- label: "Linkedin"
67+
icon: "fab fa-linkedin"
68+
url: "https://www.linkedin.com/in/iamutkarshjain/"
69+
- label: "Facebook"
70+
icon: "fab fa-facebook"
71+
url: "https://facebook.com/utkarsh.jain.376"
72+
- label: "Instagram"
73+
icon: "fab fa-instagram"
74+
url: "https://instagram.com/the_utkarshjain"
75+
76+
palakgupta889:
77+
name : "Palak Gupta"
78+
bio : "Connect with me on LinkedIn!"
79+
avatar : "https://avatars1.githubusercontent.com/u/32836916"
80+
links:
81+
- label: "Email"
82+
icon: "fas fa-envelope-square"
83+
url: "mailto:[email protected]"
84+
- label: "GitHub"
85+
icon: "fab fa-github"
86+
url: "https://github.com/palakgupta889"
87+
- label: "Linkedin"
88+
icon: "fab fa-linkedin"
89+
url: "https://www.linkedin.com/in/palakgupta889"
90+
91+
pranshukharkwal:
92+
name : "Pranshu Kharkwal"
93+
bio : ""
94+
avatar : "https://avatars0.githubusercontent.com/u/21126219?s=460&v=4"
95+
links:
96+
- label: "Email"
97+
icon: "fas fa-envelope-square"
98+
url: "#"
99+
- label: "GitHub"
100+
icon: "fab fa-github"
101+
url: "#"
102+
- label: "Linkedin"
103+
icon: "fab fa-linkedin"
104+
url: "#"
105+
- label: "Instagram"
106+
icon: "fab fa-instagram"
107+
url: "#"

_drafts/2020-06-10-introduction-to-graphql.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: post
3-
author: "Pranshu Kharkwal"
4-
author_url: https://github.com/pranshukharkwal
3+
author: "pranshukharkwal"
54
title: "Introduction to GraphQL"
65
subtitle: "The future of APIs?"
76
bg_url: "https://i.imgur.com/4BVtURe.png"

_layouts/home.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,21 @@ <h3 class="post-subtitle">{{ post.excerpt | strip_html | truncatewords: 15 }}</h
5454
<p class="meta">Posted by
5555
{% if authors.first %}
5656
{% for author in authors %}
57-
{% if post.author_url[forloop.index0] %}
58-
<a target="_blank" href="{{ post.author_url[forloop.index0] }}">{{ author }}</a>{% unless forloop.last %},{% endunless %}
57+
{% if site.data.authors[author] %}
58+
<a target="_blank" href="https://github.com/{{ author }}">{{ site.data.authors[author].name }}</a>{% unless forloop.last %},{% endunless %}
5959
{% else %}
60-
{{ author }}{% unless forloop.last %},{% endunless %}
60+
{% if post.author_github_id[forloop.index0] and post.author_github_id[forloop.index0] != "" %}
61+
<a target="_blank" href="https://github.com/{{ post.author_github_id[forloop.index0] }}">{{ author }}</a>{% unless forloop.last %},{% endunless %}
62+
{% else %}
63+
{{ author }}{% unless forloop.last %},{% endunless %}
64+
{% endif %}
6165
{% endif %}
6266
{% endfor %}
6367
{% else %}
64-
{% if post.author_url %}
65-
<a target="_blank" href="{{ post.author_url }}">{{ authors }}</a>
68+
{% if site.data.authors[post.author] %}
69+
<a target="_blank" href="https://github.com/{{ post.author }}">{{ site.data.authors[post.author].name }}</a>
70+
{% elsif post.author and post.author_github_id and post.author_github_id != "" %}
71+
<a target="_blank" href="https://github.com/{{ post.author_github_id }}">{{ authors }}</a>{% unless forloop.last %},{% endunless %}
6672
{% else %}
6773
{{ authors }}
6874
{% endif %}

0 commit comments

Comments
 (0)