-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
author.html
68 lines (60 loc) 路 2.25 KB
/
author.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
layout: page
---
<div class="staff">
{% if page.photo %}
<img class="img-rounded" src="{{ page.photo }}" alt="{{ author.display_name }}">
{% else %}
<img class="img-rounded" src="/assets/img/user.jpg" alt="{{ author.display_name }}">
{% endif %}
<h1 class="name">{{ page.display_name }}</h1>
{% if page.position %}
<h2 class="position">{{ page.position }}</h2>
{% endif %}
<p>{{ page.bio }}</p>
<h2>Posts</h2>
<ul>
{% assign filtered_posts = site.posts | where: 'author', page.name | where_exp:"post","post.is_generated != true" %}
{% for post in filtered_posts %}
<li>
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
</div>
{% assign author_urls = '' %}
{% if page.github_username %}
{% assign author_urls = author_urls | append: '"https://github.com/' | append: page.github_username | append: '",' %}
{% endif %}
{% if page.facebook_username %}
{% assign author_urls = author_urls | append: '"https://www.facebook.com/' | append: page.facebook_username | append: '",' %}
{% endif %}
{% if page.twitter_username %}
{% assign author_urls = author_urls | append: '"https://twitter.com/' | append: page.twitter_username | append: '",' %}
{% endif %}
{% if page.medium_username %}
{% assign author_urls = author_urls | append: '"https://medium.com/@' | append: page.medium_username | append: '",' %}
{% endif %}
{% if page.instagram_username %}
{% assign author_urls = author_urls | append: '"https://www.instagram.com/' | append: page.instagram_username | append: '",' %}
{% endif %}
{% if page.linkedin_username %}
{% assign author_urls = author_urls | append: '"https://www.linkedin.com/in/' | append: page.linkedin_username | append: '",' %}
{% endif %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
"name": "{{ page.display_name }}",
{% if page.photo %}
"image": "{{ page.photo }}",
{% else %}
"image": {{ "/assets/img/user.jpg" | prepend: site.baseurl | prepend: site.url }},
{% endif %}
"jobTitle": "{{ page.position }}",
"url": "{{ page.url | prepend: site.baseurl | prepend: site.url }}",
"sameAs": [
{{ author_urls | split: "," | join: "," }}
]
}
</script>