Compare commits

...

4 Commits

Author SHA1 Message Date
Joshua Potter 31dd6856e9 Add paginate-v2. 2023-12-25 12:40:44 -07:00
Joshua Potter 5551a827b9 Paginate 10 items at a time. 2023-12-25 11:38:07 -07:00
Joshua Potter 7ba663a471 Remove concept of "hidden". 2023-12-25 11:34:39 -07:00
Joshua Potter 490563840d Add a (currently) empty devlog tab. 2023-12-25 11:30:28 -07:00
14 changed files with 142 additions and 45 deletions

View File

@ -3,6 +3,7 @@
source "https://rubygems.org"
gem "jekyll-theme-chirpy", "6.2.3"
gem "jekyll-paginate-v2", "~> 3.0"
group :test do
gem "html-proofer", "5.0.8"

View File

@ -61,6 +61,8 @@ GEM
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-paginate (1.1.0)
jekyll-paginate-v2 (3.0.0)
jekyll (>= 3.0, < 5.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (3.0.0)
@ -130,7 +132,8 @@ PLATFORMS
DEPENDENCIES
html-proofer (= 5.0.8)
jekyll-paginate-v2 (~> 3.0)
jekyll-theme-chirpy (= 6.2.3)
BUNDLED WITH
2.4.10
2.4.22

View File

@ -3,6 +3,8 @@
# ========================================
theme: jekyll-theme-chirpy
plugins:
- jekyll-paginate-v2
lang: en
@ -10,7 +12,13 @@ timezone: America/New_York
avatar: https://avatars.githubusercontent.com/u/3267697?v=4
paginate: 20
pagination:
enabled: true
per_page: 10
permalink: '/page/:num/'
limit: 0
sort_field: 'date'
sort_reverse: true
# ========================================
# jekyll-seo-tag settings

View File

@ -0,0 +1,14 @@
{% if paginator.total_pages > 1 %}
<ul>
{% if paginator.previous_page %}
<li>
<a href="{{ paginator.previous_page_path | prepend: site.baseurl }}">Newer</a>
</li>
{% endif %}
{% if paginator.next_page %}
<li>
<a href="{{ paginator.next_page_path | prepend: site.baseurl }}">Older</a>
</li>
{% endif %}
</ul>
{% endif %}

80
_layouts/devlog.html Normal file
View File

@ -0,0 +1,80 @@
---
layout: default
---
{% include lang.html %}
<div id="post-list" class="flex-grow-1 px-xl-1">
{% for post in paginator.posts %}
<article class="card-wrapper card">
<a href="{{ post.url | relative_url }}" class="post-preview row g-0 flex-md-row-reverse">
{% assign card_body_col = '12' %}
{% if post.image %}
{% assign src = post.image.path | default: post.image %}
{% unless src contains '//' %}
{% assign src = post.img_path | append: '/' | append: src | replace: '//', '/' %}
{% endunless %}
{% assign alt = post.image.alt | xml_escape | default: 'Preview Image' %}
{% assign lqip = null %}
{% if post.image.lqip %}
{% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %}
{% endif %}
<div class="col-md-5">
<img src="{{ src }}" alt="{{ alt }}" {{ lqip }}>
</div>
{% assign card_body_col = '7' %}
{% endif %}
<div class="col-md-{{ card_body_col }}">
<div class="card-body d-flex flex-column">
<h1 class="card-title my-2 mt-md-0">{{ post.title }}</h1>
<div class="card-text content mt-0 mb-3">
<p>
{% include no-linenos.html content=post.content %}
{{ content | markdownify | strip_html | truncate: 500 | escape }}
</p>
</div>
<div class="post-meta flex-grow-1 d-flex align-items-end">
<div class="me-auto">
<!-- posted date -->
<i class="far fa-calendar fa-fw me-1"></i>
{% include datetime.html date=post.date lang=lang %}
<!-- categories -->
{% if post.categories.size > 0 %}
<i class="far fa-folder-open fa-fw me-1"></i>
<span class="categories">
{% for category in post.categories %}
{{ category }}
{%- unless forloop.last -%},{%- endunless -%}
{% endfor %}
</span>
{% endif %}
</div>
{% if post.pin %}
<div class="pin ms-1">
<i class="fas fa-thumbtack fa-fw"></i>
<span>{{ site.data.locales[lang].post.pin_prompt }}</span>
</div>
{% endif %}
</div>
<!-- .post-meta -->
</div>
<!-- .card-body -->
</div>
</a>
</article>
{% endfor %}
</div>
<!-- #post-list -->
{% include post-paginator.html %}

View File

@ -1,47 +1,11 @@
---
layout: default
refactor: true
---
{% include lang.html %}
{% assign pinned = site.posts | where: 'pin', 'true' %}
{% assign default = site.posts | where_exp: 'item', 'item.pin != true and item.hidden != true' %}
{% assign posts = '' | split: '' %}
<!-- Get pinned posts -->
{% assign offset = paginator.page | minus: 1 | times: paginator.per_page %}
{% assign pinned_num = pinned.size | minus: offset %}
{% if pinned_num > 0 %}
{% for i in (offset..pinned.size) limit: pinned_num %}
{% assign posts = posts | push: pinned[i] %}
{% endfor %}
{% else %}
{% assign pinned_num = 0 %}
{% endif %}
<!-- Get default posts -->
{% assign default_beg = offset | minus: pinned.size %}
{% if default_beg < 0 %}
{% assign default_beg = 0 %}
{% endif %}
{% assign default_num = paginator.posts | size | minus: pinned_num %}
{% assign default_end = default_beg | plus: default_num | minus: 1 %}
{% if default_num > 0 %}
{% for i in (default_beg..default_end) %}
{% assign posts = posts | push: default[i] %}
{% endfor %}
{% endif %}
<div id="post-list" class="flex-grow-1 px-xl-1">
{% for post in posts %}
{% for post in paginator.posts %}
<article class="card-wrapper card">
<a href="{{ post.url | relative_url }}" class="post-preview row g-0 flex-md-row-reverse">
{% assign card_body_col = '12' %}
@ -113,6 +77,4 @@ refactor: true
</div>
<!-- #post-list -->
{% if paginator.total_pages > 1 %}
{% include post-paginator.html %}
{% endif %}
{% include post-paginator.html %}

View File

@ -1,6 +1,7 @@
---
title: Tagless Final Parsing
tags: [haskell, parsing, type]
categories: home
---
In his [introductory text](https://okmij.org/ftp/tagless-final/course/lecture.pdf),

View File

@ -1,6 +1,7 @@
---
title: Effect Systems
tags: [haskell, category, effects, type]
categories: home
---
As I've begun exploring the world of so-called **algebraic effect systems**,

View File

@ -2,6 +2,6 @@
layout: archives
title: Archives
icon: fas fa-box-archive
order: 2
order: 3
---

6
_tabs/devlog.md Normal file
View File

@ -0,0 +1,6 @@
---
layout: devlog
title: Devlog
icon: fas fa-terminal
order: 1
---

View File

@ -2,5 +2,5 @@
layout: tags
title: Tags
icon: fas fa-tag
order: 1
order: 2
---

7
devlog.html Normal file
View File

@ -0,0 +1,7 @@
---
layout: devlog
pagination:
enabled: true
category: devlog
indexpage: devlog
---

View File

@ -249,6 +249,17 @@
};
version = "1.1.0";
};
jekyll-paginate-v2 = {
dependencies = ["jekyll"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1qzlqhpiqz28624fp0ak76hfy7908w6kpx62v7z43aiwjv0yc6q0";
type = "gem";
};
version = "3.0.0";
};
jekyll-redirect-from = {
dependencies = ["jekyll"];
groups = ["default"];

View File

@ -1,4 +1,7 @@
---
layout: home
# Index page
pagination:
enabled: true
category: home
indexpage: index
---