Merge branch 'master' into add-support-stackoverflow-behance

This commit is contained in:
Brandon Rosage 2019-03-07 12:08:10 -06:00
commit 8123b3ffae
3 changed files with 41 additions and 5 deletions

View file

@ -73,6 +73,18 @@ Your website will display in a two-column layout by default on larger-screen dev
Your website appears with a "light" white and gray background by default, with dark text. You can quickly switch to a "dark" background with white text by changing the line in your `_config.yml` file that reads `style: light` to `style: dark`.
#### Projects
The "My Projects" section of your website is generated by default with your nine most recently "pushed" repositories. It also excludes repositories that you forked, by default. But each of these parameters can be quickly customized in your repository's `_config.yml` file, under the `projects` dictionary line.
Parameters include:
- `sort_by`: The method by which repositories are sorted. Options include `pushed` and `stars`.
- `limit`: The maximum number of repositories that will be displayed in the "My Projects" section of your website. Out of the box, this number is set to `9`.
- `exclude`:
- `forks`: When `true`, repositories you've forked will be excluded from the listing.
- `projects`: A list the repository names you want to exclude from the listing.
#### Topics
Your website comes pre-configured with three topics (e.g. "Web design" and "Sass") that appear in a section titled "My Interests." These are also stored in your repository's `_config.yml` file, where you can define each topic's name and two other optional details:

View file

@ -16,6 +16,17 @@ defaults:
values:
layout: "post"
projects:
sort_by: pushed
# sort_by options:
# - pushed
# - stars
limit: 9
exclude:
forks: true
projects:
# - repo-name
topics:
- name: CSS
web_url: https://github.com/topics/css

View file

@ -1,10 +1,23 @@
<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>
<div class="d-sm-flex flex-wrap gutter-condensed mb-4">
{% assign public_repositories = site.github.public_repositories | sort: 'pushed_at' | reverse %}
{% for repository in public_repositories limit: 9 %}
<div class="col-sm-6 col-md-12 col-lg-6 col-xl-4 mb-3">
{% include repo-card.html %}
</div>
{% if site.projects.sort_by == 'stars' %}
{% assign sort_order = 'stargazers_count', 'last' %}
{% else %}
{% assign sort_order = 'pushed_at' %}
{% endif %}
{% 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: site.projects.limit %}
{% unless site.projects.exclude.projects contains repository.name %}
<div class="col-sm-6 col-md-12 col-lg-6 col-xl-4 mb-3">
{% include repo-card.html %}
</div>
{% endunless %}
{% endfor %}
</div>