tightened up YAML structure and taxonomy for projects

This commit is contained in:
Brandon Rosage 2019-03-07 11:29:01 -06:00
parent 8231c9fe16
commit cc3202b525
2 changed files with 14 additions and 12 deletions

View file

@ -15,15 +15,15 @@ defaults:
values: values:
layout: "post" layout: "post"
projects_sort_by: pushed projects:
# Options: sort_by: pushed
# - pushed # sort_by options:
# - stars # - pushed
# - stars
exclude_forks: true exclude:
forks: true
excluded_projects: projects:
# - Your-Repo-Name # - repo-name
topics: topics:
- name: CSS - name: CSS

View file

@ -1,18 +1,20 @@
<h2 {% if site.style == 'dark' %}class="text-white"{% endif %}>My Projects</h2> <h2 {% if site.style == 'dark' %}class="text-white"{% endif %}>My Projects</h2>
<p class="f4 mb-4 {% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %}">GitHub repositories that I've built.</p> <p class="f4 mb-4 {% if site.style == 'dark' %}text-white{% else %}text-gray{% endif %}">GitHub repositories that I've built.</p>
<div class="d-sm-flex flex-wrap gutter-condensed mb-4"> <div class="d-sm-flex flex-wrap gutter-condensed mb-4">
{% if site.projects_sort_by == 'stars' %} {% if site.projects.sort_by == 'stars' %}
{% assign sort_order = 'stargazers_count', 'last' %} {% assign sort_order = 'stargazers_count', 'last' %}
{% else %} {% else %}
{% assign sort_order = 'pushed_at' %} {% assign sort_order = 'pushed_at' %}
{% endif %} {% endif %}
{% if exclude_forks %}
{% if site.projects.exclude.forks %}
{% assign filtered_repos = site.github.public_repositories | where:'fork', false | sort: sort_order | reverse %} {% assign filtered_repos = site.github.public_repositories | where:'fork', false | sort: sort_order | reverse %}
{% else %} {% else %}
{% assign filtered_repos = site.github.public_repositories | sort: sort_order | reverse %} {% assign filtered_repos = site.github.public_repositories | sort: sort_order | reverse %}
{% endif %} {% endif %}
{% for repository in filtered_repos | limit: 9 %} {% for repository in filtered_repos | limit: 9 %}
{% unless site.excluded_projects contains repository.name %} {% unless site.projects.exclude.projects contains repository.name %}
<div class="col-sm-6 col-md-12 col-lg-6 col-xl-4 mb-3"> <div class="col-sm-6 col-md-12 col-lg-6 col-xl-4 mb-3">
{% include repo-card.html %} {% include repo-card.html %}
</div> </div>