From e7596b1b3cb58ad774aa8b7fad66d5f2298baa1a Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sat, 25 Jan 2025 20:31:01 +0100 Subject: add stale indicator + admonition css --- _plugins/filters.rb | 4 ++-- _plugins/meta.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to '_plugins') diff --git a/_plugins/filters.rb b/_plugins/filters.rb index c4ee527..78eb04f 100644 --- a/_plugins/filters.rb +++ b/_plugins/filters.rb @@ -15,9 +15,9 @@ module Filters def post_sort(posts, sort_by) # date (reverse chronological) - return posts.sort_by{ |post| -post.date.to_i } if sort_by == "date" + return posts.sort_by{ |post| -post.data['date'].to_i } if sort_by == "date" # title (case insensitive) - return posts.sort_by{ |post| post.title.downcase } if sort_by == "title" + return posts.sort_by{ |post| post.data['title'].downcase } if sort_by == "title" end end diff --git a/_plugins/meta.rb b/_plugins/meta.rb index 28afd13..0e25871 100644 --- a/_plugins/meta.rb +++ b/_plugins/meta.rb @@ -6,7 +6,7 @@ class Meta < Jekyll::Generator posts = site.collections['items'] for page in posts do # convert generated page metadata and add directly to `page.meta` in liquid - page.data['meta'] = transform_data(site, page.slug) + page.data['meta'] = transform_data(site, page.data['slug']) # set page.authors to author metadata from git+yaml page.data['authors'] = site.data['authors'].filter do |author| @@ -53,7 +53,7 @@ class Meta < Jekyll::Generator # tally tags for post in posts do - for tag in post.tags do + for tag in post.data['tags'] do tags[tag] = tags.fetch(tag, 0) + 1 end end -- cgit v1.2.3