pages/_pages/projects.md
Dinesh Natesan e27fe2a021
Categories for projects and an optional horizontal project card style (#224)
* Add webpage to academic pages list

* adding panelbear analytics

* added categories for projects and horizontal mode display for projects

* rewrote the code to ensure it works properly with current project definitions

* Style adjustments

Co-authored-by: Maruan Al-Shedivat <alshedivat.maruan@gmail.com>
2021-04-11 14:34:15 -04:00

1.6 KiB

layout title permalink description nav display_categories horizontal
page projects /projects/ A growing collection of your cool projects. true
work
fun
false
{% if site.enable_project_categories and page.display_categories %} {% for category in page.display_categories %}

{{category}}

{% assign categorized_projects = site.projects | where: "category", category %} {% assign sorted_projects = categorized_projects | sort: "importance" %} {% if page.horizontal %}
{% for project in sorted_projects %} {% include projects_horizontal.html %} {% endfor %}
{% else %}
{% for project in sorted_projects %} {% include projects.html %} {% endfor %}
{% endif %} {% endfor %}

{% else %}

{% assign sorted_projects = site.projects | sort: "importance" %}
<!-- Generate cards for each project -->
{% if page.horizontal %}
  <div class="container">
    <div class="row row-cols-2">
    {% for project in sorted_projects %}
      {% include projects_hrz.html %}
    {% endfor %}
    </div>
  </div>
{% else %}
  <div class="grid">
    {% for project in sorted_projects %}
      {% include projects.html %}
    {% endfor %}
  </div>
{% endif %}

{% endif %}