Skip to content

Commit

Permalink
Augment the display of projects
Browse files Browse the repository at this point in the history
Each project now gets assigned a weight used in the ordering on the
front page listing. Additionally, rendered summaries can be provided to
be used in the box. Three links and badges are recognized and
automatically embedded into the project page: crates.io, documentation,
and the repository url.
  • Loading branch information
HeroicKatora committed Apr 22, 2019
1 parent 226181d commit 35260e0
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 2 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
theme: jekyll-theme-slate
collections:
summaries:
projects:
output: true
16 changes: 16 additions & 0 deletions _layouts/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
---

<div>
<nav class="external-sites">
{% if page.github %}
<p><a href="{{ page.github }}">Repository</a></p>
{% endif %}
{% if page.crates_io %}
<p><a href="{{ page.crates_io }}" rel=external>
<img alt="Crates.io" src="{{ page.crates_io_badge }}" style="max-width: 100%;"/>
</a></p>
{% endif %}
{% if page.docs %}
<p><a href="{{ page.docs }}" rel=external>
<img alt="Documentation" src="{{ page.docs_badge }}" style="max-width: 100%;"/>
</a></p>
{% endif %}
</nav>

<h1 class="post-title">
{{ page.title }}
</h1>
Expand Down
6 changes: 6 additions & 0 deletions _projects/image.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
layout: project
name: "image"
weight: 1000
crates_io: "https://crates.io/crates/image"
crates_io_badge: "https://img.shields.io/crates/v/image.svg"
github: "https://github.com/image-rs/image"
docs: "https://docs.rs/image"
docs_badge: "https://docs.rs/image/badge.svg"
---

The `image` project.
6 changes: 6 additions & 0 deletions _summaries/image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: "image"
---

Aggregates major image formats into a coherent interface for reading, writing
and editing.
10 changes: 10 additions & 0 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@ a:hover {
max-width: 100%;
}
}

.external-sites {
float: right;
}

.external-sites>p {
margin-top: 1px;
margin-bottom: 1px;
padding: unset;
}
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
---

<div class="project-list">
{% for project in site.projects %}
{% assign sorted_projects = site.projects | sort: "weight" | reverse %}
{% for project in sorted_projects %}
{% assign summary = site.summaries | where: "name",project.name | first %}
<article>
<h2><a href="{{ project.url }}">{{ project.name }}</a></h2>
<p>{{ project.content | markdownify }}</p>
<p>{{ summary.content }}</p>
</article>
{% endfor %}
</div>

0 comments on commit 35260e0

Please sign in to comment.