date modification et tri
This commit is contained in:
parent
d1e981b305
commit
43c6ce4b4e
@ -10,6 +10,8 @@
|
|||||||
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
|
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
|
||||||
{categories}
|
{categories}
|
||||||
{tags}
|
{tags}
|
||||||
|
{date}
|
||||||
|
{datemodif}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<p>{snippet}</p>
|
<p>{snippet}</p>
|
||||||
@ -40,9 +42,24 @@
|
|||||||
if (value === '') {
|
if (value === '') {
|
||||||
return `${value}`;
|
return `${value}`;
|
||||||
} else {
|
} else {
|
||||||
return `<div><i class="fa fa-tag fa-fw"></i>${value}</div>`;
|
return `<div class="me-sm-4"><i class="fa fa-tag fa-fw"></i>${value}</div>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (prop === 'date') {
|
||||||
|
if (value === '') {
|
||||||
|
return `${value}`;
|
||||||
|
} else {
|
||||||
|
return `<div class="me-sm-4"><i class="far fa-calendar fa-fw"></i>${value}</div>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (prop === 'datemodif') {
|
||||||
|
if (value === '') {
|
||||||
|
return `${value}`;
|
||||||
|
} else {
|
||||||
|
return `<div class="me-sm-4" style='color:red'><i class="far fa-calendar fa-fw" style='color:red'></i>${value}</div>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -16,8 +16,12 @@ layout: page
|
|||||||
{% for post in page.posts %}
|
{% for post in page.posts %}
|
||||||
<li class="d-flex justify-content-between px-md-3">
|
<li class="d-flex justify-content-between px-md-3">
|
||||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||||
<span class="dash flex-grow-1"></span>
|
<span class="dash flex-grow-1"></span>
|
||||||
|
{% if post.last_modified_at %}
|
||||||
|
{% include datetime.html date=post.last_modified_at class='text-muted small text-nowrap' lang=lang %}
|
||||||
|
{% endif %}
|
||||||
{% include datetime.html date=post.date class='text-muted small text-nowrap' lang=lang %}
|
{% include datetime.html date=post.date class='text-muted small text-nowrap' lang=lang %}
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -86,8 +86,13 @@ refactor: true
|
|||||||
<div class="me-auto">
|
<div class="me-auto">
|
||||||
<!-- posted date -->
|
<!-- posted date -->
|
||||||
<i class="far fa-calendar fa-fw me-1"></i>
|
<i class="far fa-calendar fa-fw me-1"></i>
|
||||||
{% include datetime.html date=post.date lang=lang %}
|
{% include datetime.html date=post.date lang=lang %}
|
||||||
|
|
||||||
|
{% if post.last_modified_at %}
|
||||||
|
<i class="far fa-calendar fa-fw me-1" style='color:red'></i>
|
||||||
|
{% include datetime.html date=post.last_modified_at lang=lang %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- categories -->
|
<!-- categories -->
|
||||||
{% if post.categories.size > 0 %}
|
{% if post.categories.size > 0 %}
|
||||||
<i class="far fa-folder-open fa-fw me-1"></i>
|
<i class="far fa-folder-open fa-fw me-1"></i>
|
||||||
|
@ -4,13 +4,19 @@ swcache: true
|
|||||||
---
|
---
|
||||||
|
|
||||||
[
|
[
|
||||||
{% for post in site.posts %}
|
{% assign posts = site.posts | sort: 'last_modified_at' | reverse %}
|
||||||
|
{% for post in posts %}
|
||||||
{
|
{
|
||||||
"title": {{ post.title | jsonify }},
|
"title": {{ post.title | jsonify }},
|
||||||
"url": {{ post.url | relative_url | jsonify }},
|
"url": {{ post.url | relative_url | jsonify }},
|
||||||
"categories": {{ post.categories | join: ', ' | jsonify }},
|
"categories": {{ post.categories | join: ', ' | jsonify }},
|
||||||
"tags": {{ post.tags | join: ', ' | jsonify }},
|
"tags": {{ post.tags | join: ', ' | jsonify }},
|
||||||
"date": "{{ post.date }}",
|
"date": "{{ post.date | date: '%d/%m/%Y' }}",
|
||||||
|
{% if post.last_modified_at %}
|
||||||
|
"datemodif": "{{ post.last_modified_at | date: '%d/%m/%Y' }}",
|
||||||
|
{% else %}
|
||||||
|
"datemodif": "",
|
||||||
|
{% endif %}
|
||||||
{% include no-linenos.html content=post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
{% assign _content = content | strip_html | strip_newlines %}
|
{% assign _content = content | strip_html | strip_newlines %}
|
||||||
"snippet": {{ _content | truncate: 200 | jsonify }}
|
"snippet": {{ _content | truncate: 200 | jsonify }}
|
||||||
|
Loading…
Reference in New Issue
Block a user