Skip to content

Commit 3d048d0

Browse files
committed
Add Julia-specific feed for Julia Bloggers aggregator
1 parent 9774b25 commit 3d048d0

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

feed.julia.xml

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
# This feed is just for Julia content, in order to submit to the Julia Bloggers aggregator.
3+
# The starting point of this file is https://github.com/jekyll/jekyll-feed/blob/master/lib/jekyll-feed/feed.xml
4+
# The feed for all posts is autogenerated.
5+
6+
layout: null
7+
---
8+
<?xml version="1.0" encoding="utf-8"?>
9+
{% if page.xsl %}
10+
<?xml-stylesheet type="text/xml" href="{{ '/feed.xslt.xml' | absolute_url }}"?>
11+
{% endif %}
12+
<feed xmlns="http://www.w3.org/2005/Atom" {% if site.lang %}xml:lang="{{ site.lang }}"{% endif %}>
13+
<generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
14+
<link href="{{ page.url | absolute_url }}" rel="self" type="application/atom+xml" />
15+
<link href="{{ '/' | absolute_url }}" rel="alternate" type="text/html" {% if site.lang %}hreflang="{{ site.lang }}" {% endif %}/>
16+
<updated>{{ site.time | date_to_xmlschema }}</updated>
17+
<id>{{ '/' | absolute_url | xml_escape }}</id>
18+
19+
{% if site.title %}
20+
<title type="html">{{ site.title | smartify | xml_escape }}</title>
21+
{% elsif site.name %}
22+
<title type="html">{{ site.name | smartify | xml_escape }}</title>
23+
{% endif %}
24+
25+
{% if site.description %}
26+
<subtitle>{{ site.description | xml_escape }}</subtitle>
27+
{% endif %}
28+
29+
{% if site.author %}
30+
<author>
31+
<name>{{ site.author.name | default: site.author | xml_escape }}</name>
32+
{% if site.author.email %}
33+
<email>{{ site.author.email | xml_escape }}</email>
34+
{% endif %}
35+
{% if site.author.uri %}
36+
<uri>{{ site.author.uri | xml_escape }}</uri>
37+
{% endif %}
38+
</author>
39+
{% endif %}
40+
41+
{% assign posts = site.tags.julia | where_exp: "post", "post.draft != true" %}
42+
{% for post in posts limit: 10 %}
43+
<entry{% if post.lang %}{{" "}}xml:lang="{{ post.lang }}"{% endif %}>
44+
<title type="html">{{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title>
45+
<link href="{{ post.url | absolute_url }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
46+
<published>{{ post.date | date_to_xmlschema }}</published>
47+
<updated>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</updated>
48+
<id>{{ post.id | absolute_url | xml_escape }}</id>
49+
<content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}">{{ post.content | strip | xml_escape }}</content>
50+
51+
{% assign post_author = post.author | default: post.authors[0] | default: site.author %}
52+
{% assign post_author = site.data.authors[post_author] | default: post_author %}
53+
{% assign post_author_email = post_author.email | default: nil %}
54+
{% assign post_author_uri = post_author.uri | default: nil %}
55+
{% assign post_author_name = post_author.name | default: post_author %}
56+
57+
<author>
58+
<name>{{ post_author_name | default: "" | xml_escape }}</name>
59+
{% if post_author_email %}
60+
<email>{{ post_author_email | xml_escape }}</email>
61+
{% endif %}
62+
{% if post_author_uri %}
63+
<uri>{{ post_author_uri | xml_escape }}</uri>
64+
{% endif %}
65+
</author>
66+
67+
{% if post.category %}
68+
<category term="{{ post.category | xml_escape }}" />
69+
{% endif %}
70+
71+
{% for tag in post.tags %}
72+
<category term="{{ tag | xml_escape }}" />
73+
{% endfor %}
74+
75+
{% if post.excerpt and post.excerpt != empty %}
76+
<summary type="html">{{ post.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary>
77+
{% endif %}
78+
79+
{% assign post_image = post.image.path | default: post.image %}
80+
{% if post_image %}
81+
{% unless post_image contains "://" %}
82+
{% assign post_image = post_image | absolute_url %}
83+
{% endunless %}
84+
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ post_image | xml_escape }}" />
85+
{% endif %}
86+
</entry>
87+
{% endfor %}
88+
</feed>

0 commit comments

Comments
 (0)