Skip to content

Commit 7bafbb0

Browse files
committed
Adds code for Atom feed
1 parent 3a6311d commit 7bafbb0

File tree

8 files changed

+150
-87
lines changed

8 files changed

+150
-87
lines changed

eleventy.config.js

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,12 @@ const path = require('path');
33
const Image = require('@11ty/eleventy-img');
44
const markdownIt = require("markdown-it");
55

6-
module.exports = (config) => {
7-
/*
8-
Setup collections
9-
https://www.11ty.dev/docs/collections/
10-
*/
11-
config.addCollection("posts", function(collectionApi) {
12-
return collectionApi.getFilteredByGlob("src/_content/posts/*.md");
13-
});
14-
15-
config.addCollection("places", function(collectionApi) {
16-
return collectionApi.getFilteredByGlob("src/_content/places/*.md");
17-
});
18-
19-
config.addCollection("presenters", function(collectionApi) {
20-
return collectionApi.getFilteredByGlob("src/_content/presenters/*.md");
21-
});
6+
const setupCollections = require('./lib/collections');
7+
const setupFeed = require('./lib/feed');
228

23-
config.addCollection("organizers", function(collectionApi) {
24-
return collectionApi.getFilteredByGlob("src/_content/organizers/*.md").sort(function(a, b) {
25-
let nameA = a.data.name.toUpperCase();
26-
let nameB = b.data.name.toUpperCase();
27-
if (nameA < nameB) return -1;
28-
else if (nameA > nameB) return 1;
29-
else return 0;
30-
}).filter(item => !item.data.hidden);
31-
});
32-
33-
config.addCollection("sponsorsByLevel", function(collectionApi) {
34-
const sponsors = collectionApi.getFilteredByGlob("src/_content/sponsors/*.md");
35-
const visibleSponsors = sponsors.filter(sponsor => !sponsor.data.hidden);
36-
const levelOrder = [
37-
"Diamond",
38-
"Platinum",
39-
"Gold",
40-
"Silver",
41-
"Bronze",
42-
"Coffee",
43-
"Opportunity Grant",
44-
"Community",
45-
];
46-
47-
const sponsorsByLevel = visibleSponsors.reduce((acc, sponsor) => {
48-
const level = sponsor.data.level;
49-
if (!acc[level]) {
50-
acc[level] = [];
51-
}
52-
acc[level].push(sponsor);
53-
return acc;
54-
}, {});
55-
56-
// Sort levels based on predefined order
57-
const sortedSponsorsByLevel = {};
58-
levelOrder.forEach(level => {
59-
if (sponsorsByLevel[level]) {
60-
sortedSponsorsByLevel[level] = sponsorsByLevel[level];
61-
}
62-
});
63-
64-
return sortedSponsorsByLevel;
65-
});
9+
module.exports = (config) => {
10+
setupCollections(config);
11+
setupFeed(config);
6612

6713
/*
6814
Setup passthrough file copy

lib/collections.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
module.exports = function(config) {
2+
/*
3+
Setup collections
4+
https://www.11ty.dev/docs/collections/
5+
*/
6+
config.addCollection("posts", function(collectionApi) {
7+
return collectionApi.getFilteredByGlob("src/_content/posts/*.md");
8+
});
9+
10+
config.addCollection("places", function(collectionApi) {
11+
return collectionApi.getFilteredByGlob("src/_content/places/*.md");
12+
});
13+
14+
config.addCollection("presenters", function(collectionApi) {
15+
return collectionApi.getFilteredByGlob("src/_content/presenters/*.md");
16+
});
17+
18+
config.addCollection("organizers", function(collectionApi) {
19+
return collectionApi.getFilteredByGlob("src/_content/organizers/*.md").sort(function(a, b) {
20+
let nameA = a.data.name.toUpperCase();
21+
let nameB = b.data.name.toUpperCase();
22+
if (nameA < nameB) return -1;
23+
else if (nameA > nameB) return 1;
24+
else return 0;
25+
}).filter(item => !item.data.hidden);
26+
});
27+
28+
config.addCollection("sponsorsByLevel", function(collectionApi) {
29+
const sponsors = collectionApi.getFilteredByGlob("src/_content/sponsors/*.md");
30+
const visibleSponsors = sponsors.filter(sponsor => !sponsor.data.hidden);
31+
const levelOrder = [
32+
"Diamond",
33+
"Platinum",
34+
"Gold",
35+
"Silver",
36+
"Bronze",
37+
"Coffee",
38+
"Opportunity Grant",
39+
"Community",
40+
];
41+
42+
const sponsorsByLevel = visibleSponsors.reduce((acc, sponsor) => {
43+
const level = sponsor.data.level;
44+
if (!acc[level]) {
45+
acc[level] = [];
46+
}
47+
acc[level].push(sponsor);
48+
return acc;
49+
}, {});
50+
51+
// Sort levels based on predefined order
52+
const sortedSponsorsByLevel = {};
53+
levelOrder.forEach(level => {
54+
if (sponsorsByLevel[level]) {
55+
sortedSponsorsByLevel[level] = sponsorsByLevel[level];
56+
}
57+
});
58+
59+
return sortedSponsorsByLevel;
60+
});
61+
}

lib/feed.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const pluginRss = require("@11ty/eleventy-plugin-rss");
2+
3+
module.exports = function(config) {
4+
config.addPlugin(pluginRss);
5+
6+
// eleventy-plugin-rss is Nunjucks-only, so add filters for Liquid
7+
config.addLiquidFilter(
8+
"dateToRfc3339",
9+
pluginRss.dateToRfc3339
10+
);
11+
12+
config.addLiquidFilter(
13+
"getNewestCollectionItemDate",
14+
pluginRss.getNewestCollectionItemDate
15+
);
16+
17+
config.addLiquidFilter(
18+
"htmlToAbsoluteUrls",
19+
pluginRss.htmlToAbsoluteUrls
20+
);
21+
}

package-lock.json

Lines changed: 22 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
],
2828
"author": "DEFNA",
2929
"bugs": {
30-
"url": "https://github.com/djangocon/durham.djangocon.us/issues"
30+
"url": "https://github.com/djangocon/2024.djangocon.us/issues"
3131
},
32-
"homepage": "https://github.com/djangocon/durham.djangocon.us#README",
32+
"homepage": "https://github.com/djangocon/2024.djangocon.us#README",
3333
"devDependencies": {
3434
"@11ty/eleventy": "^2.0.1",
3535
"@11ty/eleventy-img": "^4.0.2",
3636
"@tailwindcss/container-queries": "^0.1.1",
37+
"@11ty/eleventy-plugin-rss": "^1.2.0",
3738
"@tailwindcss/typography": "^0.5.10",
3839
"autoprefixer": "^10.4.18",
3940
"concurrently": "^8.2.2",

src/about/conduct.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h1 class="mb-8 pageheading">{{ title }}</h1>
3636
<section class="self-start p-8 prose bg-white border-4 rounded border-central-park-green lg:prose-lg">
3737
<h3 class="mb-8 text-lg font-bold font-heading lg:text-2xl">Need help?</h3>
3838
<div class="space-y-6 lead">
39-
<p>If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact the conference Code of Conduct committee at <a href="mailto:{{site.conduct_email}}" class="link">{{site.conduct_email}}</a>{% comment %} or <a href="tel:201-899-4189" class="link">201-899-4189</a>{% endcomment %}.</p>
39+
<p>If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact the conference Code of Conduct committee at <a href="mailto:{{ site.conduct_email }}" class="link">{{ site.conduct_email }}</a>{% comment %} or <a href="tel:201-899-4189" class="link">201-899-4189</a>{% endcomment %}.</p>
4040
<p>To ensure we receive all the necessary information, please refer to our <a href="#procedures-for-reporting-incidents" class="link">Procedures for Reporting Incidents</a>.</p>
4141
</div>
4242
</section>
@@ -186,7 +186,7 @@ <h2>Examples of Inappropriate Behavior</h2>
186186

187187
<h2>Photography</h2>
188188

189-
<p>In order to make DjangoCon US 2024 a great experience for everyone, do not photograph, video, or audio record anyone at DjangoCon without their express permission, sought in advance. If someone does not want to be photographed, video or audio recorded, please respect their wishes.</p>
189+
<p>In order to make DjangoCon US {{ site.conf_year }} a great experience for everyone, do not photograph, video, or audio record anyone at DjangoCon without their express permission, sought in advance. If someone does not want to be photographed, video or audio recorded, please respect their wishes.</p>
190190

191191
<p>Crowd shots are permitted, but when only the faces of a few people are visible, permission should be sought from all of those individuals.</p>
192192

0 commit comments

Comments
 (0)