Skip to content

Commit b5064ae

Browse files
mfennerSamk13
andauthored
improve atom feed (#239)
* include feature image * include multiple authors with optional orcid * include tags * move images out of blog-posts * include dois (with temporary prefix 10.5555) * add feed links * move blog-post image into subfolder Co-authored-by: Sam Arbid <[email protected]>
1 parent e84c525 commit b5064ae

File tree

72 files changed

+849
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+849
-236
lines changed

eleventy.config.js

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from "node:fs";
22
import eleventySass from "@11tyrocks/eleventy-plugin-sass-lightningcss";
33
import eleventyNavigation from "@11ty/eleventy-navigation";
4-
import { feedPlugin } from "@11ty/eleventy-plugin-rss";
4+
import pluginRss from "@11ty/eleventy-plugin-rss";
55

66
export default async function (eleventyConfig) {
77
// copy all `src/assets` to `_site/static"
@@ -83,24 +83,19 @@ export default async function (eleventyConfig) {
8383
return input.startsWith(prefix);
8484
});
8585

86+
// Format authors array with comma separation
87+
eleventyConfig.addFilter("formatAuthors", (authorKeys, authorsData) => {
88+
if (!Array.isArray(authorKeys) || !authorsData) return "";
89+
90+
const authorNames = authorKeys
91+
.map((key) => authorsData[key]?.name)
92+
.filter((name) => name); // Remove empty names
93+
94+
return authorNames.join(", ");
95+
});
96+
8697
// RSS feed
87-
eleventyConfig.addPlugin(feedPlugin, {
88-
type: "atom", // or "rss", "json"
89-
outputPath: "/feed.xml",
90-
collection: {
91-
name: "posts", // iterate over `collections.posts`
92-
limit: 10, // 0 means no limit
93-
},
94-
metadata: {
95-
language: "en",
96-
title: "Invenio Blog",
97-
subtitle: "Follow news and updates on Invenio world.",
98-
base: "https://inveniosoftware.org/blog/",
99-
author: {
100-
name: "Invenio Software",
101-
102-
},
103-
},
98+
eleventyConfig.addPlugin(pluginRss, {
10499
htmlBasePluginOptions: {
105100
baseHref: "",
106101
},

src/_data/post_authors.json

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"carlinmack": {
3+
"name": "Carlin MacKenzie"
4+
},
5+
"carsonicator": {
6+
"name": "Matt Carson"
7+
},
8+
"chokribr": {
9+
"name": "Chokri Ben Romdhane"
10+
},
11+
"debverhoff": {
12+
"name": "Deb Verhoff"
13+
},
14+
"dfdan": {
15+
"name": "Dan Granville"
16+
},
17+
"egabancho": {
18+
"name": "Esteban J.G. Gabancho"
19+
},
20+
"fenekku": {
21+
"name": "Guillaume Viger"
22+
},
23+
"hbayindir": {
24+
"name": "Hakan Bayındır"
25+
},
26+
"Herrner": {
27+
"name": "Kai Woerner"
28+
},
29+
"jbenito3": {
30+
"name": "Jose Benito Gonzalez Lopez"
31+
},
32+
"jleendertse": {
33+
"name": "Jan Leendertse"
34+
},
35+
"kglibrarian": {
36+
"name": "Karen Gutzman"
37+
},
38+
"kpsherva": {
39+
"name": "Karolina Przerwa"
40+
},
41+
"kristiholmes": {
42+
"name": "Kristi Holmes"
43+
},
44+
"lkeefe": {
45+
"name": "Lisa O'Keefe"
46+
},
47+
"lnielsen": {
48+
"name": "Lars Holm Nielsen",
49+
"url": "https://orcid.org/0000-0001-8135-3489"
50+
},
51+
"max-moser": {
52+
"name": "Max Moser"
53+
},
54+
"mesemus": {
55+
"name": "Mirek Simek"
56+
},
57+
"mfenner": {
58+
"name": "Martin Fenner",
59+
"url": "https://orcid.org/0000-0003-1419-2405"
60+
},
61+
"mhucka": {
62+
"name": "Michael Hucka"
63+
},
64+
"ntarocco": {
65+
"name": "Nicola Tarocco",
66+
"url": "https://orcid.org/0000-0002-2227-1229"
67+
},
68+
"palkerecsenyi": {
69+
"name": "Pal Kerecsenyi"
70+
},
71+
"ppanero": {
72+
"name": "Pablo Panero"
73+
},
74+
"ptamarit": {
75+
"name": "Pablo Tamarit"
76+
},
77+
"RosaLo": {
78+
"name": "Rosa Lönneborg"
79+
},
80+
"sankora": {
81+
"name": "Sefakor Ankora"
82+
},
83+
"Samk13": {
84+
"name": "Sam Arbid",
85+
"url": "https://orcid.org/0000-0001-8482-9964"
86+
},
87+
"saragon02": {
88+
"name": "Sara Gonzales",
89+
"url": "https://orcid.org/0000-0002-1193-2298"
90+
},
91+
"SarahW91": {
92+
"name": "Sarah Wiechers"
93+
},
94+
"slint": {
95+
"name": "Alex Ioannidis",
96+
"url": "https://orcid.org/0000-0002-5082-6404"
97+
},
98+
"splith": {
99+
"name": "Brian Kelly"
100+
},
101+
"tiborsimko": {
102+
"name": "Tibor Šimko"
103+
},
104+
"tmorell": {
105+
"name": "Tim Morell"
106+
},
107+
"utnapischtim": {
108+
"name": "Christoph Ladurner"
109+
},
110+
"wgresshoff": {
111+
"name": "Werner Greßhoff"
112+
},
113+
"zzacharo": {
114+
"name": "Zacharias Zacharodimos"
115+
}
116+
}

src/_includes/layouts/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<meta name="generator" content="{{ eleventy.generator }}">
99
<title>{{ title }} - inveniosoftware.org</title>
1010
<link rel="icon" href="/assets/images/favicon.ico">
11+
<link rel="alternate" type="application/atom+xml" title="Invenio Blog Feed" href="/feed.xml">
1112
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
1213
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
1314
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600|Oswald|Source+Code+Pro:400&display=swap" rel="stylesheet">

src/_includes/layouts/blog-post.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% layout 'layouts/page.html' %}
22

33
{% block page_title %}Invenio Blog{% endblock %}
4-
{% block page_subtitle %}Follow news and updates on Invenio world{% endblock %}
4+
{% block page_subtitle %}Follow news and updates from the Invenio community{% endblock %}
55

66
{% block content %}
77
<section id="blog-post-content-section" class="section-content-light-bg">

src/_includes/partials/blog-post-full.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@
44
<div class="blog-post blog-post-frame">
55
<header class="post-header">
66
<h2>{{ title }}</h2>
7-
<p class="post-meta">
8-
<i class='fa fa-user text-muted'></i>
9-
<span class="author">{{ author }}</span>
7+
<div class="post-meta">
8+
<i class='fa fa-users text-muted'></i>
9+
<span class="author">
10+
{{- authors | formatAuthors: post_authors -}}
11+
</span>
1012
<i class='fa fa-calendar text-muted'></i>
1113
<span>{{ date | dateFormat }}</span>
12-
<i class='fa fa-users text-muted'></i>
13-
<span class="label {{ team_colour | default: 'invenio-team' }}"><a class="team-url" href="{{ team_url }}">{{ team }}</a></span>
14-
</p>
14+
<i class='fa fa-tags text-muted'></i>
15+
<span>
16+
{%- if tags -%}
17+
{%- for tag in tags -%}
18+
{%- unless tag == "posts" -%}
19+
<span class="label label-primary">{{ tag }}</span>
20+
{%- endunless -%}
21+
{%- endfor -%}
22+
{%- endif -%}
23+
</span>
24+
</div>
1525
</header>
1626
<article class="post-content">
1727
{{ content }}

src/_includes/partials/blog-post-homepage.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ <h3>
55
</h3>
66
<div class="hp-blog-list-item-divider"></div>
77
<p class="hp-blog-list-item-meta">
8-
<i class='fa fa-user text-muted'></i>
9-
<span class="author">{{ author }}</span>
8+
<i class='fa fa-users text-muted'></i>
9+
<span class="author">
10+
{{ post.data.authors | formatAuthors: post_authors }}
11+
</span>
1012
<i class='fa fa-calendar text-muted'></i>
1113
<span>{{ date | dateFormat }}</span>
12-
<i class='fa fa-users text-muted'></i>
13-
<span class="label {{ team_colour | default: 'invenio-team' }}"><a class="team-url" href="{{ team_url }}">{{ team }}</a></span>
14+
<span>
15+
{%- if tags -%}
16+
{%- for tag in post.data.tags -%}
17+
<a class="tag" href="/blog/tags/{{ tag }}/">{{ tag }}</a>{% if not loop.last %}, {% endif %}
18+
{%- endfor -%}
19+
{%- endif -%}
20+
</span>
1421
</p>
1522
</header>
1623
</div>

src/_includes/partials/blog-post-item.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,24 @@ <h3>
77
{{ title }}
88
{% endif %}
99
</h3>
10-
<p class="blog-list-item-meta">
11-
<i class='fa fa-user text-muted'></i>
12-
<span class="author">{{ author }}</span>
10+
<div class="blog-list-item-meta">
11+
<i class='fa fa-users text-muted'></i>
12+
<span class="author">
13+
{{ post.data.authors | formatAuthors: post_authors }}
14+
</span>
1315
<i class='fa fa-calendar text-muted'></i>
1416
<span>{{ date | dateFormat }}</span>
15-
<i class='fa fa-users text-muted'></i>
16-
<span class="label {{ team_colour | default: 'invenio-team' }}"><a class="team-url" href="{{ team_url }}">{{ team }}</a></span>
17-
</p>
17+
<div>
18+
<i class='fa fa-tags text-muted'></i>
19+
{%- if post.data.tags -%}
20+
{%- for tag in post.data.tags -%}
21+
{%- unless tag == "posts" -%}
22+
<span class="label label-primary">{{ tag }}</span>
23+
{%- endunless -%}
24+
{%- endfor -%}
25+
{%- endif -%}
26+
</div>
27+
</div>
1828
</header>
1929
<div class="blog-list-item-content">
2030
{{ content }}

src/_includes/partials/blog-post-top.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ <h2>
55
</h2>
66
<p class="blog-list-item-meta">
77
<i class='fa fa-user text-muted'></i>
8-
<span class="author">{{ author }}</span>
8+
<span class="author">
9+
{{ authors | formatAuthors: post_authors }}
10+
</span>
911
<i class='fa fa-calendar text-muted'></i>
1012
<span>{{ date | dateFormat }}</span>
11-
<i class='fa fa-users text-muted'></i>
12-
<span class="label {{ team_colour | default: 'invenio-team' }}"><a class="team-url" href="{{ team_url }}">{{ team }}</a></span>
13+
{%- if tags -%}
14+
{%- for tag in tags -%}
15+
{%- unless tag == "posts" -%}
16+
<span class="label label-primary">{{ tag }}</span>
17+
{%- endunless -%}
18+
{%- endfor -%}
19+
{%- endif -%}
1320
</p>
1421
</header>
1522
<div class="blog-list-item-content">

src/_includes/partials/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ <h3 class="contact-title">Keep in touch</h3>
108108
</td>
109109
</tr>
110110
<tr>
111-
<td><a href="/blog/">Blog</a></td>
111+
<td><a href="/feed.xml">Blog Feed</a></td>
112112
</tr>
113113
</tbody>
114114
</table>

0 commit comments

Comments
 (0)