Skip to content

Commit

Permalink
Refactor: Use predefined vars for posts to sort: 'date'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasulab committed Jan 19, 2025
1 parent bf52718 commit 5f717cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/_includes/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% if site.posts.size == 0 %}
<h2>No job post found</h2>
{% 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 %}
<a href="{{ post.permalink }}" class="list-item container">
Expand Down
4 changes: 2 additions & 2 deletions docs/_layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ <h1 class="post-title" data-aos="fade-up" data-aos-delay="200" data-aos-offset="
{{ site.data.translations.postUpdatedBy[page.lang] }}:
<time>
{% if page.lang == 'en' %}
{{ page.commit_at | date_to_string }}
{{ page.date | date_to_string }}
{% else %}
{{ page.commit_at | date: "%Y-%m-%d " }}
{{ page.date | date: "%Y-%m-%d " }}
{% endif %}
</time>
</small>
Expand Down
8 changes: 4 additions & 4 deletions docs/upsert_data_by_readme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}
---
Expand Down

0 comments on commit 5f717cb

Please sign in to comment.