-
Notifications
You must be signed in to change notification settings - Fork 35
/
all.njk
77 lines (69 loc) · 3.27 KB
/
all.njk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
layout: null
permalink: /feeds/all.xml
---
{% extends "./../_layouts/feed.njk" %}
{% block title %}Nicolas Hoizey - All contents{% endblock %}
{% block self %}all.xml{% endblock %}
{% block page %}archives/{% endblock %}
{% block id %}archives/{% endblock %}
{% block update %}{{ collections.archives | rssLastUpdatedDate }}{% endblock %}
{% block entries %}
{% for entry in collections.archives | limit(20) %}
{%- set absoluteEntryUrl -%}{{- pkg.homepage -}}{{- entry.url -}}{%- endset -%}
{%- set readableDate = entry.date | formattedDateTime -%}
{%- set icon -%}
{%- if entry.data.layout == 'article' -%}🖋{%- endif -%}
{%- if entry.data.layout == 'link' -%}🔗{%- endif -%}
{%- if entry.data.layout == 'billet' -%}📓{%- endif -%}
{%- if entry.data.layout == 'note' -%}💬{%- endif -%}
{%- endset -%}
<entry>
<title>{{ icon }} {{ entry.data.body.title }}</title>
<link href="{{ absoluteEntryUrl }}" />
<updated>{{ entry.date | rssDate }}</updated>
<id>{{ absoluteEntryUrl }}</id>
<content type="html">
{% if entry.data.layout == 'link' %}
{%- if "youtube.com" in entry.data.link -%}
{# Use the poster image for YouTube videos #}
{%- set youtubeId = entry.data.link | split("v=") | last -%}
{%- set urlToScreenshot = "https://img.youtube.com/vi/" ~ youtubeId ~ "/maxresdefault.jpg" -%}
{%- else -%}
{%- set urlToScreenshot = entry.data.link -%}
{%- endif -%}
{%- set thumbUrl -%}{{ screenshots.prefix }}{{ urlToScreenshot | url_encode }}{{ screenshots.suffix }}{%- endset -%}
<p>
{% if entry.data.authors %}
{%- for author in entry.data.authors -%}
{%- if not loop.first -%}
{%- if not loop.last -%},&ensp;{%- else -%}&ensp;and&ensp;{%- endif -%}
{%- endif -%}
{{- author -}}
{%- endfor -%}
<br />
{% endif %}
<a href="{{ entry.data.link }}">{{ entry.data.link }}</a>
</p>
<figure><img src="https://res.cloudinary.com/nho/image/fetch/c_fill,f_auto,q_auto,w_300,h_300/{{ thumbUrl | url_encode }}" width="300" height="300" /></figure>
{% endif %}
{% if entry.data.layout == 'billet' and entry.data.photo %}
<div style="max-width: 33%; float: right; margin: 0 0 1em 1em;">
<p>Une photo prise un {{ entry.date | dayMonth('fr') }} :</p>
<figure>
<img
src="https://res.cloudinary.com/nho/image/fetch/w_800,q_auto,f_auto/{{ entry.data.photo.src }}"
alt="{{ entry.data.photo.title }}"
width="{{ entry.data.photo.width }}"
height="{{ entry.data.photo.height }}"
crossorigin="anonymous"
/>
<figcaption><a href="{{ entry.data.photo.url }}">{{ entry.data.photo.title }}</a></figcaption>
</figure>
</div>
{% endif %}
{{ entry.templateContent | cleanDeepLinks | htmlToAbsoluteUrls(absoluteEntryUrl) }}
</content>
</entry>
{% endfor %}
{% endblock %}