From cc3202b525019e165a5ffe7ca8321c2a9552a97e Mon Sep 17 00:00:00 2001 From: Brandon Rosage Date: Thu, 7 Mar 2019 11:29:01 -0600 Subject: [PATCH] tightened up YAML structure and taxonomy for `projects` --- _config.yml | 18 +++++++++--------- _includes/projects.html | 8 +++++--- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/_config.yml b/_config.yml index d09a080..98d9a54 100644 --- a/_config.yml +++ b/_config.yml @@ -15,15 +15,15 @@ defaults: values: layout: "post" -projects_sort_by: pushed -# Options: -# - pushed -# - stars - -exclude_forks: true - -excluded_projects: -# - Your-Repo-Name +projects: + sort_by: pushed + # sort_by options: + # - pushed + # - stars + exclude: + forks: true + projects: + # - repo-name topics: - name: CSS diff --git a/_includes/projects.html b/_includes/projects.html index afdfdaf..d0ccc24 100644 --- a/_includes/projects.html +++ b/_includes/projects.html @@ -1,18 +1,20 @@

My Projects

GitHub repositories that I've built.

- {% if site.projects_sort_by == 'stars' %} + {% if site.projects.sort_by == 'stars' %} {% assign sort_order = 'stargazers_count', 'last' %} {% else %} {% assign sort_order = 'pushed_at' %} {% endif %} - {% if exclude_forks %} + + {% if site.projects.exclude.forks %} {% assign filtered_repos = site.github.public_repositories | where:'fork', false | sort: sort_order | reverse %} {% else %} {% assign filtered_repos = site.github.public_repositories | sort: sort_order | reverse %} {% endif %} + {% for repository in filtered_repos | limit: 9 %} - {% unless site.excluded_projects contains repository.name %} + {% unless site.projects.exclude.projects contains repository.name %}
{% include repo-card.html %}