Skip to content

Commit

Permalink
Add people directory initial setup (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschrijver committed Apr 25, 2019
1 parent aeffa0a commit 30e12d5
Show file tree
Hide file tree
Showing 11 changed files with 186 additions and 17 deletions.
9 changes: 4 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,8 @@ collections:
output: true
permalink: /:collection/:path/
people_directory:
people: true
output: true
permalink: /:collection/:path/
permalink: /people/:path/

# Defaults
defaults:
Expand Down Expand Up @@ -322,10 +321,10 @@ defaults:
comments: false
sidebar:
nav: "docs"
# _people
# _people_directory
- scope:
path: "_people"
path: ""
type: people_directory
values:
layout: single
author_profile: false
author_profile: true
2 changes: 2 additions & 0 deletions _data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ main:
url: /activities/
- title: "Resources"
url: /resources/
# - title: "People"
# url: /people/
- title: "About"
url: /about/

Expand Down
19 changes: 19 additions & 0 deletions _includes/people-collection.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% assign entries = site[include.collection] %}

{% if include.sort_by == 'name' %}
{% if include.sort_order == 'reverse' %}
{% assign entries = entries | sort: 'name' | reverse %}
{% else %}
{% assign entries = entries | sort: 'name' %}
{% endif %}
{% elsif include.sort_by == 'profession' %}
{% if include.sort_order == 'reverse' %}
{% assign entries = entries | sort: 'profession' | reverse %}
{% else %}
{% assign entries = entries | sort: 'profession' %}
{% endif %}
{% endif %}

{%- for person in entries -%}
{% include person-single.html %}
{%- endfor -%}
34 changes: 34 additions & 0 deletions _includes/person-single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{% if person.avatar %}
{% capture avatar %}{{ person.avatar }}{% endcapture %}
{% else %}
{% assign avatar = site.teaser %}
{% endif %}

{% if person.id %}
{% assign title = person.name | markdownify | remove: "<p>" | remove: "</p>" %}
{% else %}
{% assign title = person.name %}
{% endif %}

<div class="{{ include.type | default: "list" }}__item">
<article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork">
{% if include.type == "grid" and avatar %}
<div class="author__avatar">
<img src=
{% if avatar contains "://" %}
"{{ avatar }}"
{% else %}
"{{ avatar | relative_url }}"
{% endif %}
alt="">
</div>
{% endif %}
<h2 class="archive__item-title" itemprop="headline">
<a href="{{ person.url | relative_url }}" rel="permalink">{{ title }}</a>
</h2>
{% if person.position %}
<p class="page__meta"><i class="far fa-user" aria-hidden="true"></i> {{ person.position | markdownify | strip_html | truncate: 30 }}</p>
{% endif %}
{% if person.bio %}<p class="archive__item-excerpt" itemprop="description">{{ person.bio | markdownify | strip_html | truncate: 100 }}</p>{% endif %}
</article>
</div>
9 changes: 9 additions & 0 deletions _layouts/people.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: archive
---

{{ content }}

<div class="entries-{{ page.entries_layout }}">
{% include people-collection.html collection=page.collection sort_by=page.sort_by sort_order=page.sort_order type=page.entries_layout %}
</div>
92 changes: 92 additions & 0 deletions _layouts/person.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
layout: default
---

{% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
{% include page__hero.html %}
{% elsif page.header.video.id and page.header.video.provider %}
{% include page__hero_video.html %}
{% endif %}

{% if page.url != "/" and site.breadcrumbs %}
{% unless paginator %}
{% include breadcrumbs.html %}
{% endunless %}
{% endif %}

<div id="main" role="main">
{% include sidebar.html %}

<article class="page" itemscope itemtype="http://schema.org/CreativeWork">
{% if page.title %}<meta itemprop="headline" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
{% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
{% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date: "%B %d, %Y" }}">{% endif %}
{% if page.last_modified_at %}<meta itemprop="dateModified" content="{{ page.last_modified_at | date: "%B %d, %Y" }}">{% endif %}

<div class="page__inner-wrap">
{% unless page.header.overlay_color or page.header.overlay_image %}
<header>
{% if page.title %}<h1 id="page-title" class="page__title" itemprop="headline">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</h1>{% endif %}
{% if page.read_time %}
<p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i> {% include read-time.html %}</p>
{% endif %}
</header>
{% endunless %}

<section class="page__content" itemprop="text">
{% if page.toc %}
<aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
<nav class="toc">
<header><h4 class="nav__title"><i class="fas fa-{{ page.toc_icon | default: 'file-alt' }}"></i> {{ page.toc_label | default: site.data.ui-text[site.locale].toc_label }}</h4></header>
{% include toc.html sanitize=true html=content h_min=1 h_max=6 class="toc__menu" %}
</nav>
</aside>
{% endif %}
{{ content }}
{% if page.link %}<div><a href="{{ page.link }}" class="btn btn--primary">{{ site.data.ui-text[site.locale].ext_link_label | default: "Direct Link" }}</a></div>{% endif %}
</section>

<footer class="page__meta">
{% if site.data.ui-text[site.locale].meta_label %}
<h4 class="page__meta-title">{{ site.data.ui-text[site.locale].meta_label }}</h4>
{% endif %}
{% include page__taxonomy.html %}
{% if page.last_modified_at %}
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.last_modified_at | date: "%Y-%m-%d" }}">{{ page.last_modified_at | date: "%B %d, %Y" }}</time></p>
{% elsif page.date %}
<p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %d, %Y" }}</time></p>
{% endif %}
</footer>

{% if page.share %}{% include social-share.html %}{% endif %}

{% include post_pagination.html %}
</div>

{% if jekyll.environment == 'production' and site.comments.provider and page.comments %}
{% include comments.html %}
{% endif %}
</article>

{% comment %}<!-- only show related on a post page when `related: true` -->{% endcomment %}
{% if page.id and page.related and site.related_posts.size > 0 %}
<div class="page__related">
<h4 class="page__related-title">{{ site.data.ui-text[site.locale].related_label | default: "You May Also Enjoy" }}</h4>
<div class="grid__wrapper">
{% for post in site.related_posts limit:4 %}
{% include archive-single.html type="grid" %}
{% endfor %}
</div>
</div>
{% comment %}<!-- otherwise show recent posts if no related when `related: true` -->{% endcomment %}
{% elsif page.id and page.related %}
<div class="page__related">
<h4 class="page__related-title">{{ site.data.ui-text[site.locale].related_label | default: "You May Also Enjoy" }}</h4>
<div class="grid__wrapper">
{% for post in site.posts limit:4 %}
{% include archive-single.html type="grid" %}
{% endfor %}
</div>
</div>
{% endif %}
</div>
8 changes: 8 additions & 0 deletions _pages/people.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: People
layout: people
permalink: /people/
collection: people_directory
entries_layout: grid
classes: wide
---
6 changes: 0 additions & 6 deletions _people/jane-doe.md

This file was deleted.

6 changes: 0 additions & 6 deletions _people/john-doe.md

This file was deleted.

9 changes: 9 additions & 0 deletions _people_directory/arnold-schrijver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Arnold Schrijver
position: Product owner / developer
avatar: "/assets/images/people/author-arnold-schrijver.jpg"
bio: "Interested in all aspects of technology, but primary interest is how to make software more humane, better aligned to humans."
author: Arnold Schrijver
---

Hi, I am Arnold, and community member
9 changes: 9 additions & 0 deletions _people_directory/siddhi-upadhyaya.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Siddhi Upadhyaya
position: Community staff
avatar: "/assets/images/people/author-siddhi-upadhyaya.jpg"
bio: A student, dancer, and robotics enthusiast who wants the goal of technology to be promoting human flourishing and well being, not distracting attention.
author: Siddhi Upadhyaya
---

Hi, I am Siddhi, and community staff

0 comments on commit 30e12d5

Please sign in to comment.