Browse Source

Replaces `if X == false` by `unless X`

master
Samuel FORESTIER 1 year ago
parent
commit
bed1102b02
3 changed files with 6 additions and 6 deletions
  1. +2
    -2
      atom.xml
  2. +2
    -2
      feed.json
  3. +2
    -2
      search.json

+ 2
- 2
atom.xml View File

@@ -20,7 +20,7 @@ layout: null
<rights>All rights reserved {{ site.author.name }} {{ site.posts.last.date | date: "%Y" }} - {{ "now" | date: "%Y" }}</rights>

{% for post in site.posts limit: site.feed.limit %}
{%- if post.draft == false %}
{%- unless post.draft %}
<entry>
<title>{{ post.title | xml_escape }}</title>
<link rel="alternate" type="text/html" href="{{ site.url }}{{ post.url }}"/>
@@ -29,6 +29,6 @@ layout: null
<updated>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</updated>
<content type="html">{{ post.content | markdownify | xml_escape }}</content>
</entry>
{%- endif %}
{%- endunless %}
{% endfor %}
</feed>

+ 2
- 2
feed.json View File

@@ -12,7 +12,7 @@ layout: null
},
"icon": "{{ site.url }}{{ site.logo }}",
"favicon": "{{ site.url }}/img/favicon/favicon.ico",
"items": [{% for post in site.posts limit: site.feed.limit %}{% if post.draft == false %}
"items": [{% for post in site.posts limit: site.feed.limit %}{% unless post.draft %}
{
"title": {{ post.title | jsonify }},
"date_published": {{ post.date | date_to_xmlschema | jsonify }},
@@ -23,6 +23,6 @@ layout: null
"name": {{ site.author.name | jsonify }}
},
"content_html": {{ post.content | markdownify | jsonify }}
}{% unless forloop.last %},{% endunless %}{% endif %}{% endfor %}
}{% unless forloop.last %},{% endunless %}{% endunless %}{% endfor %}
]
}

+ 2
- 2
search.json View File

@@ -1,11 +1,11 @@
---
layout: null
---
[{% for post in site.posts %}{% if post.draft == false %}
[{% for post in site.posts %}{% unless post.draft %}
{
"title": "{{ post.title | escape }}",
"category": "{{ post.category }}",
"url": "{{ site.baseurl }}{{ post.url }}",
"date": "{{ post.date }}"
}{% unless forloop.last %},{% endunless %}{% endif %}{% endfor %}
}{% unless forloop.last %},{% endunless %}{% endunless %}{% endfor %}
]

Loading…
Cancel
Save