Skip to content

Commit

Permalink
ordenación del feed
Browse files Browse the repository at this point in the history
  • Loading branch information
arandanos80 authored Dec 2, 2024
1 parent 95c7400 commit e31dbf4
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions docs/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@
<pubDate>{{ site.time | date_to_rfc822 }}</pubDate>
<generator>Jekyll</generator>

{% for post in site.posts %}
{% assign tips = site.pages | where: "layout", "tip" %}
{% assign sorted_tips = tips | sort: "title" %}

{% for page in sorted_tips %}
{% assign tip_number = page.title | remove: "tip" | remove: ".md" | plus: 0 %}
{% assign sorted = sorted | push: { "number": tip_number, "page": page } %}
{% endfor %}

{% assign sorted_tips = sorted | sort: "number" %}
{% for tip in sorted_tips %}
<item>
<title>{{ post.title | xml_escape }}</title>
<link>{{ post.url | absolute_url }}</link>
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
<guid isPermaLink="true">{{ post.url | absolute_url }}</guid>
<description>{{ post.excerpt | xml_escape }}</description>
<title>{{ tip.page.title }}</title>
<link>{{ tip.page.url | absolute_url }}</link>
<pubDate>{{ tip.page.date | date_to_rfc822 }}</pubDate>
<guid isPermaLink="true">{{ tip.page.url | absolute_url }}</guid>
<description>{{ tip.page.excerpt }}</description>
</item>
{% endfor %}
</channel>
Expand Down

0 comments on commit e31dbf4

Please sign in to comment.