Skip to content

Commit

Permalink
Add a project based layout
Browse files Browse the repository at this point in the history
Presents projects in a flex list that utilizes two-columns for wide
displays and a single column for small ones. Each project page has a
coherent layout similar to that of an article but focussed on
presentation instead of text writing, i.e. it is wider compared to the
standard layout from the theme.
  • Loading branch information
HeroicKatora committed Apr 22, 2019
1 parent 8a447fc commit 226181d
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 6 deletions.
5 changes: 4 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
theme: jekyll-theme-slate
theme: jekyll-theme-slate
collections:
projects:
output: true
49 changes: 49 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">

<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,maximum-scale=2">
<link rel="stylesheet" type="text/css" media="screen" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">

{% seo %}
</head>

<body>

<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="{{ site.github.repository_url }}">View on GitHub</a>

<h1 id="project_title">{{ site.title | default: site.github.repository_name }}</h1>
<h2 id="project_tagline">{{ site.description | default: site.github.project_tagline }}</h2>

{% if site.show_downloads %}
<section id="downloads">
<a class="zip_download_link" href="{{ site.github.zip_url }}">Download this project as a .zip file</a>
<a class="tar_download_link" href="{{ site.github.tar_url }}">Download this project as a tar.gz file</a>
</section>
{% endif %}
</header>
</div>

<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<main id="main_content" class="inner-wide">
{{ content }}
</main>
</div>

<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
{% if site.github.is_project_page %}
<p class="copyright">{{ site.title | default: site.github.repository_name }} maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></p>
{% endif %}
<p>Published with <a href="https://pages.github.com">GitHub Pages</a></p>
</footer>
</div>
</body>
</html>
13 changes: 13 additions & 0 deletions _layouts/project.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: default
---

<div>
<h1 class="post-title">
{{ page.title }}
</h1>

<main class="post-content">
{{ content }}
</main>
</div>
6 changes: 6 additions & 0 deletions _projects/image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
layout: project
name: "image"
---

The `image` project.
51 changes: 51 additions & 0 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
---

@import "jekyll-theme-slate";

.inner-wide {
position: relative;
max-width: 992px;
padding: 20px 10px;
margin: 0 auto;
}

.image-rs-inline-avatar {
display: inline;
margin: 0px;
height: 1em;
vertical-align: text-bottom;
}

.post-info {
text-align: right;
font-weight: bold;
}

.subtle-link {
color: inherit;
}

a:hover {
color: #0F79D0;
text-decoration: none;
}

.project-list {
display: flex;
max-width: 300ch;
flex-wrap: wrap;
justify-content: space-between;
}

.project-list > article {
width: 45%;
max-width: 45%;
box-sizing: border-box;
}
@media screen and (max-width: 992px) {
.project-list > article {
width: 100%;
max-width: 100%;
}
}
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: "default"
description: "Open-source, image related Rust crates."
---

<div class="project-list">
{% for project in site.projects %}
<article>
<h2><a href="{{ project.url }}">{{ project.name }}</a></h2>
<p>{{ project.content | markdownify }}</p>
</article>
{% endfor %}
</div>
5 changes: 0 additions & 5 deletions index.md

This file was deleted.

0 comments on commit 226181d

Please sign in to comment.