Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Display github avatars of authors in learning path #44

Merged
merged 4 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ hugo new path-name/subpath2.md
| `sub` | Boolean | Specifies if a learning path is path or subpath | `false` |
| `keywords` | Array | Search terms for the learning path, used by the search bar to do fuzzy search | `["python", "backend"]` |
| `tags` | Array | Used to generate tag pages | `["python", "backend"]` |
| `authors` | Array | github usernames of authors | `["author1", "author2"]` |

### License
This project is licensed under [MIT License](LICENSE)
3 changes: 1 addition & 2 deletions archetypes/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ image: images/learning-path-name/image.png
sub: false
keywords: ["keyword1", "keyword2"]
tags: ["tag1", "tag2"]
authors: ["author1","author2"]
---

A learning path for learning {insert-tech} curated by {insert-curator-github-username}

## Why learn X ❓
Applications of {X}.

Expand Down
5 changes: 1 addition & 4 deletions content/django/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ image: images/django/django.jpg
sub: false
keywords: ["python", "django", "backend"]
tags: ["python", "django", "backend"]
authors: ["irenekurien"]
---

<i> "The web framework for perfectionists with deadlines." </i> ✨
<br><br>
Learning path for Django curated by [Irene](https://github.com/irenekurien/)🎀

## Why learn Django ❓
Django is a popular web framework built on top of python. It helps programmers rapidly create maintainable and flexiable web applications powered by an SQL Database. <br>
<br>
Expand Down
3 changes: 1 addition & 2 deletions content/frontend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ image: images/frontend/fe.png
sub: false
keywords: ["web", "frontend", "html", "css", "javascipt"]
tags: ["web", "frontend", "html", "css", "javascipt"]
authors: ["akhilmhdh"]
---

Learning path for Frontend Web Development curated by [Akhil](https://github.com/akhilmhdh/)🎀

## Install and setup stuffs 🚧

For learning Web Development you need to first set up the following things
Expand Down
3 changes: 1 addition & 2 deletions content/hacking/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ image: images/hacking/hacker.jpg
sub: false
keywords: ["hacking", "bounty"]
tags: ["hacking", "bounty"]
authors: ["fasalmbt"]
---

by [Fasal](https://github.com/fasalmbt/) 🕶️

### Programming Knowledge

Programming knowledge is a must obviously.
Expand Down
3 changes: 1 addition & 2 deletions content/html-css/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ featured: false
sub: false
keywords: ["web", "frontend", "html", "css"]
tags: ["web", "frontend", "html", "css"]
authors: ["aka8921"]
---

Learning path for HTML & CSS curated by [Vighnesh](https://github.com/aka8921/)🎀

## Why learn HTML & CSS ❓

HTML & CSS is the backbone of layout & designing of web pages. Whatever you *SEE* in a web browser is basically HTML and CSS. Add some JavaScript with it and you'll have a pretty decent web app.
Expand Down
15 changes: 11 additions & 4 deletions themes/tinkerhub/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@ <h1>Contents</h1>
<div class="image" style="background-image: url({{ .Site.BaseURL }}{{ .Params.image }});"></div>
{{ end }}
<header>
<h1>{{ .Title }} {{ if eq .Params.author true }}<small>by @{{ .Params.author }}</small>{{ end }}</h1>
<h1>{{ .Title }}</h1>
<section>
{{if .Params.authors}}
<p>Curated By</p>
{{range $author := .Params.authors}}
{{$url := printf "%s" $author | printf "%s%s" "https://github.com/" | printf "%s"}}
{{$imageurl := printf "%s" ".png?size=48" | printf "%s%s" $url}}
<a href={{$url}}><img class="avatar" src={{$imageurl}} alt={{ printf "%s" $author | printf "%s%s" "Avatar of " }}></a>
{{end}}
</section>
{{end}}
</header>
<section class="content">{{ .Content }}</section>
</article>
Expand All @@ -32,9 +42,6 @@ <h1>Related</h1>
<li>
<a href="{{ .RelPermalink }}">
<span class="name">{{ .Title }}</span>
{{ if eq .Params.author true }}
<span class="author">by @{{ .Params.author }}</span>
{{ end }}
</a>
</li>
{{ end }}
Expand Down
9 changes: 6 additions & 3 deletions themes/tinkerhub/less/layouts/single.less
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@

article {
header {
padding-bottom: 40px;
border-bottom: 2px solid #EFF0F2;
margin-bottom: 32px;
margin-bottom: 1em;

h1 {
font-size: 32px;
Expand Down Expand Up @@ -321,6 +319,11 @@
margin-bottom: 24px;
}
}
.avatar
{
border-radius: 50%;
padding: 1em;
}

//
// chroma
Expand Down
8 changes: 5 additions & 3 deletions themes/tinkerhub/static/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,7 @@ body {
display: none;
}
.single article header {
padding-bottom: 40px;
border-bottom: 2px solid #EFF0F2;
margin-bottom: 32px;
margin-bottom: 1em;
}
.single article header h1 {
font-size: 32px;
Expand Down Expand Up @@ -381,6 +379,10 @@ body {
.content dd {
margin-bottom: 24px;
}
.avatar {
border-radius: 50%;
padding: 1em;
}
.language-diff .gd,
.language-patch .gd {
color: #ff4164;
Expand Down