Skip to content

Commit 34b9ebd

Browse files
committed
Fixed last-mod display for non-English named posts.
1 parent add170b commit 34b9ebd

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

_includes/panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h3 data-toc-skip>
2323
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
2424

2525
{% for item in update_list %}
26-
{% assign post_url = item | split: "::" | last | prepend: "/posts/" | append: "/" %}
26+
{% assign post_url = item | split: "::" | last | url_encode | prepend: "/posts/" | append: "/" %}
2727
{% assign post = site.posts | where: "url", post_url | first %}
2828

2929
{% if post %}

_layouts/post.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,22 @@ <h1 data-toc-skip>{{ page.title }}</h1>
3939
{{ page.url | split: "/" | last }}
4040
{%- endcapture -%}
4141

42-
{% assign record = site.data.updates | where: "filename", filename | first %}
42+
{% for item in site.data.updates %}
43+
{% assign encode_filename = item.filename | url_encode %}
44+
{% if filename == encode_filename %}
45+
{% assign lastmod = item.lastmod %}
46+
{% break %}
47+
{% endif %}
48+
{% endfor %}
4349

44-
{% if record %}
50+
{% if lastmod %}
4551
<div>
4652
Updated
4753
<span class="timeago lastmod"
4854
data-toggle="tooltip" data-placement="bottom"
49-
title="{{ record.lastmod | date: site.data.date_format.tooltip }}">
50-
{{ record.lastmod | date: site.data.date_format.post }}
51-
<i class="unloaded">{{ record.lastmod | date_to_xmlschema}}</i>
55+
title="{{ lastmod | date: site.data.date_format.tooltip }}">
56+
{{ lastmod | date: site.data.date_format.post }}
57+
<i class="unloaded">{{ lastmod | date_to_xmlschema}}</i>
5258
</span>
5359
</div>
5460
{% endif %}

0 commit comments

Comments
 (0)