From bcbc912693152a3917883fa9a5b51a032e17dc86 Mon Sep 17 00:00:00 2001 From: Shale XIONG <shalexiong@Shales-MacBook.local> Date: Sat, 19 Nov 2016 16:05:06 +0000 Subject: [PATCH] Change the person list in research pages and teaching pages. --- _config.yml | 5 +++++ _includes/person-cards-small.html | 14 ++++++++++++++ _includes/person-photo-small.html | 7 +++++++ _layouts/research.html | 4 +--- _layouts/teaching.html | 10 ++++++++++ assets/blog.scss | 24 +++++++++++++++++------- 6 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 _includes/person-cards-small.html create mode 100644 _includes/person-photo-small.html create mode 100644 _layouts/teaching.html diff --git a/_config.yml b/_config.yml index 2dd3681..afe95e6 100644 --- a/_config.yml +++ b/_config.yml @@ -40,6 +40,11 @@ defaults: path: "research" values: layout: research + - + scope: + path: "teaching" + values: + layout: teaching scholar: source: publications diff --git a/_includes/person-cards-small.html b/_includes/person-cards-small.html new file mode 100644 index 0000000..ff7b5fd --- /dev/null +++ b/_includes/person-cards-small.html @@ -0,0 +1,14 @@ +<div class="people"> +{% for person in include.people %}{% assign row = forloop.index | modulo: include.people.size %} +{% if row == 1%}<div class="card-deck-wrapper"><div class="card-deck">{% endif %} +<div class="card"> + <div class="card-block text-xs-center people"> + <a href="{{ person.url }}"> + {% include person-photo-small.html %} + <h6 class="card-title small-title">{{ person.firstname }}<br/>{{ person.lastname }}</h6> + </a> + </div> +</div> +{% if row == 0 or forloop.last %}</div></div>{% endif %} +{% endfor %} +</div> diff --git a/_includes/person-photo-small.html b/_includes/person-photo-small.html new file mode 100644 index 0000000..8c88d4d --- /dev/null +++ b/_includes/person-photo-small.html @@ -0,0 +1,7 @@ +{% assign path = person.url | prepend: '/images' | replace: '.html','.jpg' %} +{% assign file = site.static_files | where: "path", path | first %} +{% if file %} +<img class="person-img-small img-circle" src="{{ file.path }}" alt="Photo of {{ person.firstname }} {{ person.lastname }}" /> +{% else %} +<div class="person-img-small fa-stack fa-5x"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-user fa-stack-1x fa-inverse"></i></div> +{% endif %} diff --git a/_layouts/research.html b/_layouts/research.html index 32e4cff..d46f453 100644 --- a/_layouts/research.html +++ b/_layouts/research.html @@ -6,11 +6,9 @@ layout: page {% assign people = site.people | where_exp: "person", "person.projects contains page.project_id" %} {% if people.size > 0 %} <h3>People</h3> -{% include person-cards.html people=people %} +{% include person-cards-small.html people=people %} {% endif %} -{% if page.project_id != "sl" %} <h3>Recent Publications</h3> {% bibliography -q @*[project ~= {{page.project_id}}] --max 10 %} -{% endif %} diff --git a/_layouts/teaching.html b/_layouts/teaching.html new file mode 100644 index 0000000..34655ef --- /dev/null +++ b/_layouts/teaching.html @@ -0,0 +1,10 @@ +--- +layout: page +--- +{{ content }} + +{% assign people = site.people | where_exp: "person", "person.projects contains page.project_id" %} +{% if people.size > 0 %} +<h3>People</h3> +{% include person-cards-small.html people=people %} +{% endif %} diff --git a/assets/blog.scss b/assets/blog.scss index 27c4a43..11e662c 100644 --- a/assets/blog.scss +++ b/assets/blog.scss @@ -250,15 +250,25 @@ h6, .h6 { .card-deck { margin-bottom: 1.25rem; } + .person-img { + margin-left: auto; + margin-right: auto; + width: 160px; + text-align: center; + display: block; + } + .person-img-small { + margin-left: auto; + margin-right: auto; + width: 60px; + text-align: center; + display: block; + } + .small-title { + font-size:small; + } } -.person-img { - margin-left: auto; - margin-right: auto; - width: 160px; - text-align: center; - display: block; -} /* * Blog posts -- GitLab