Skip to content

Commit

Permalink
add category system
Browse files Browse the repository at this point in the history
  • Loading branch information
theycallmezeal committed Jun 3, 2024
1 parent b92081d commit 59d7874
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 3 deletions.
4 changes: 4 additions & 0 deletions _categories/just-for-fun.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
layout: category
category: just-for-fun
---
4 changes: 4 additions & 0 deletions _categories/linguistics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
layout: category
category: linguistics
---
5 changes: 4 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ markdown: kramdown

collections:
posts:
permalink: /posts/:title
permalink: /article/:title
categories:
output: true
permalink: /articles/:title
16 changes: 16 additions & 0 deletions _layouts/category.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: default
css: articles
---

<p><a href="/articles">All posts</a></p>

{% for post in site.posts %}
{% if post.categories contains page.category %}
<section class="post">
<h1><a href="{{ post.url }}">{{ post.title }}</a></h1>
{{ post.excerpt }}
<p><a href="{{ post.url }}">Continue reading &rarr;</a></p>
</section>
{% endif %}
{% endfor %}
8 changes: 6 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<link rel="stylesheet" href="/css/{{ stylesheet }}.css" media="screen" type="text/css">
{% endfor %}
{% endif %}
{% if layout.css %}
{% for stylesheet in layout.css %}
<link rel="stylesheet" href="/css/{{ stylesheet }}.css" media="screen" type="text/css">
{% endfor %}
{% endif %}
</head>
<body>
<header>
Expand All @@ -26,7 +31,7 @@ <h1><a href="/index">Adam An</a></h1>
<main>
<section id="title">
<h1>{{page.title}}</h1>
{% if page.date %}
{% if page.collection == 'posts' %}
<h2 id="date">{{ page.date | date: '%B %d, %Y' }}</h2>
{% endif %}
{% if page.subtitle %}
Expand All @@ -36,6 +41,5 @@ <h2>{{page.subtitle}}</h2>
</section>
<section id="content">{{content}}</section>
</main>

</body>
</html>
2 changes: 2 additions & 0 deletions _posts/2024-01-23-syntax-cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
layout: default
title: Syntax cookbook
css: syntax
categories:
- linguistics
---

Here's a "cookbook" of various kinds of English syntax trees. This is my attempt at capturing a happy medium of what's commonly introduced in introductory texts and my own undergrad syntax class.
Expand Down
2 changes: 2 additions & 0 deletions _posts/2024-05-20-ten-things.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
layout: default
title: Ten things
css: ten-things
categories:
- just-for-fun
---

I once saw a kooky old professor website with a page full of lists of ten things. I never found it again, but in tribute to that, here are some lists of ten things.
Expand Down
2 changes: 2 additions & 0 deletions _posts/2024-06-02-connections-vault.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: default
title: The Connections vault
categories:
- just-for-fun
---

Here are some Connections puzzles I've written.
Expand Down
9 changes: 9 additions & 0 deletions articles.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
css: articles
---

<div id="categories">
<p>Categories:</p>
<ul id="categories">
{% for category in site.categories %}
<li><a href="{{ category.url }}">{{ category.title }}</a></li>
{% endfor %}
</ul>
</div>

{% if site.posts.size == 0 %}
<p>Coming soon...</p>
{% endif %}
Expand Down
14 changes: 14 additions & 0 deletions css/articles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@

.post > * + * {
margin-top: 0.5rem;
}

#categories {
display: flex;
gap: 1rem;
}

#categories ul {
list-style-type: none;
}

#categories li:not(:last-child):after {
content: "|";
padding-left: 1rem;
}
4 changes: 4 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,8 @@ a[name] {

img {
max-width: 100%;
}

li ol, li ul {
margin-left: 1rem;
}

0 comments on commit 59d7874

Please sign in to comment.