Skip to content

Commit

Permalink
collections
Browse files Browse the repository at this point in the history
  • Loading branch information
alxdhuang committed Mar 27, 2019
1 parent 3929067 commit ab07b07
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 6 deletions.
7 changes: 7 additions & 0 deletions _authors/alxdhuang.md
@@ -0,0 +1,7 @@
---
short_name: alxdhuang
name: Alexander Huang
position: Boss
---

Alexander Huang is a game programmer.
19 changes: 19 additions & 0 deletions _config.yml
@@ -0,0 +1,19 @@
collections:
authors:
output: true

defaults:
- scope:
path: ""
type: "authors"
values:
layout: "author"
- scope:
path: ""
type: "posts"
values:
layout: "post"
- scope:
path: ""
values:
layout: "default"
4 changes: 3 additions & 1 deletion _data/navigation.yml
Expand Up @@ -3,4 +3,6 @@
- name: About
link: /about.html
- name: Blog
link: /blog.html
link: /blog.html
- name: Staff
link: /staff.html
15 changes: 15 additions & 0 deletions _layouts/author.html
@@ -0,0 +1,15 @@
---
layout: default
---
<h1>{{ page.name }}</h1>
<h2>{{ page.position }}</h2>

{{ content }}

<h2>Posts</h2>
<ul>
{% assign filtered_posts = site.posts | where: 'author', page.short_name %}
{% for post in filtered_posts %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
9 changes: 8 additions & 1 deletion _layouts/post.html
Expand Up @@ -2,6 +2,13 @@
layout: default
---
<h1>{{ page.title }}</h1>
<p>{{ page.date | date_to_string }} {% if page.author %}- {{ page.author }}{% endif %}</p>

<p>
{{ page.date | date_to_string }}
{% assign author = site.authors | where: 'short_name', page.author | first %}
{% if author %}
- <a href="{{ author.url }}">{{ author.name }}</a>
{% endif %}
</p>

{{ content }}
2 changes: 1 addition & 1 deletion _posts/2019-03-27-why-do-i-blog.md
@@ -1,3 +1,3 @@
---
layout: post
author: alxdhuang
---
1 change: 0 additions & 1 deletion about.md
@@ -1,5 +1,4 @@
---
layout: default
title: About
---

Expand Down
1 change: 0 additions & 1 deletion blog.html
@@ -1,5 +1,4 @@
---
layout: default
title: Blog
---
<h1>Latest Posts</h1>
Expand Down
1 change: 0 additions & 1 deletion index.html
@@ -1,5 +1,4 @@
---
layout: default
title: Home
---
<h1>{{ "Hello World!" | downcase }}</h1>
14 changes: 14 additions & 0 deletions staff.html
@@ -0,0 +1,14 @@
---
title: Staff
---
<h1>Staff</h1>

<ul>
{% for author in site.authors %}
<li>
<h2><a href="{{ author.url }}">{{ author.name }}</a></h2>
<h3>{{ author.position }}</h3>
<p>{{ author.content | markdownify }}</p>
</li>
{% endfor %}
</ul>

0 comments on commit ab07b07

Please sign in to comment.