From 5f717cbd222e7b1f328753acbd44c180c07a3d48 Mon Sep 17 00:00:00 2001 From: Yohei Yasukawa Date: Sun, 19 Jan 2025 13:25:54 +0900 Subject: [PATCH] Refactor: Use predefined vars for posts to sort: 'date' cf. https://jekyllrb.com/docs/front-matter/\#predefined-variables-for-posts --- docs/_includes/posts.html | 2 +- docs/_layouts/post.html | 4 ++-- docs/upsert_data_by_readme.rb | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/_includes/posts.html b/docs/_includes/posts.html index 1cfb92ad..bdadbf77 100644 --- a/docs/_includes/posts.html +++ b/docs/_includes/posts.html @@ -2,7 +2,7 @@ {% if site.posts.size == 0 %}

No job post found

{% else %} - {% assign related = site.posts | sort: "commit_at" | reverse | where:"lang", page.lang %} + {% assign related = site.posts | sort: "date" | reverse | where:"lang", page.lang %} {% if related.size > 0 %} {% for post in related %} diff --git a/docs/_layouts/post.html b/docs/_layouts/post.html index 462aac78..e735c3e8 100644 --- a/docs/_layouts/post.html +++ b/docs/_layouts/post.html @@ -12,9 +12,9 @@

diff --git a/docs/upsert_data_by_readme.rb b/docs/upsert_data_by_readme.rb index b01facc9..c0ae4124 100755 --- a/docs/upsert_data_by_readme.rb +++ b/docs/upsert_data_by_readme.rb @@ -77,12 +77,12 @@ layout: post lang: #{lang} permalink: /#{lang}/#{id} - title: #{name} + commit_url: #{latest_commit_url} + date: #{latest_commit_at} + link: #{link} + title: #{name} description: '#{Sanitize.clean(CGI.unescapeHTML description).strip}' categories: #{is_full_remote} - link: #{link} - commit_url: #{latest_commit_url} - commit_at: #{latest_commit_at} redirect_from: - /#{lang}/#{id_v1} ---