-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
150 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
module.exports = function(config) { | ||
/* | ||
Setup collections | ||
https://www.11ty.dev/docs/collections/ | ||
*/ | ||
config.addCollection("posts", function(collectionApi) { | ||
return collectionApi.getFilteredByGlob("src/_content/posts/*.md"); | ||
}); | ||
|
||
config.addCollection("places", function(collectionApi) { | ||
return collectionApi.getFilteredByGlob("src/_content/places/*.md"); | ||
}); | ||
|
||
config.addCollection("presenters", function(collectionApi) { | ||
return collectionApi.getFilteredByGlob("src/_content/presenters/*.md"); | ||
}); | ||
|
||
config.addCollection("organizers", function(collectionApi) { | ||
return collectionApi.getFilteredByGlob("src/_content/organizers/*.md").sort(function(a, b) { | ||
let nameA = a.data.name.toUpperCase(); | ||
let nameB = b.data.name.toUpperCase(); | ||
if (nameA < nameB) return -1; | ||
else if (nameA > nameB) return 1; | ||
else return 0; | ||
}).filter(item => !item.data.hidden); | ||
}); | ||
|
||
config.addCollection("sponsorsByLevel", function(collectionApi) { | ||
const sponsors = collectionApi.getFilteredByGlob("src/_content/sponsors/*.md"); | ||
const visibleSponsors = sponsors.filter(sponsor => !sponsor.data.hidden); | ||
const levelOrder = [ | ||
"Diamond", | ||
"Platinum", | ||
"Gold", | ||
"Silver", | ||
"Bronze", | ||
"Coffee", | ||
"Opportunity Grant", | ||
"Community", | ||
]; | ||
|
||
const sponsorsByLevel = visibleSponsors.reduce((acc, sponsor) => { | ||
const level = sponsor.data.level; | ||
if (!acc[level]) { | ||
acc[level] = []; | ||
} | ||
acc[level].push(sponsor); | ||
return acc; | ||
}, {}); | ||
|
||
// Sort levels based on predefined order | ||
const sortedSponsorsByLevel = {}; | ||
levelOrder.forEach(level => { | ||
if (sponsorsByLevel[level]) { | ||
sortedSponsorsByLevel[level] = sponsorsByLevel[level]; | ||
} | ||
}); | ||
|
||
return sortedSponsorsByLevel; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const pluginRss = require("@11ty/eleventy-plugin-rss"); | ||
|
||
module.exports = function(config) { | ||
config.addPlugin(pluginRss); | ||
|
||
// eleventy-plugin-rss is Nunjucks-only, so add filters for Liquid | ||
config.addLiquidFilter( | ||
"dateToRfc3339", | ||
pluginRss.dateToRfc3339 | ||
); | ||
|
||
config.addLiquidFilter( | ||
"getNewestCollectionItemDate", | ||
pluginRss.getNewestCollectionItemDate | ||
); | ||
|
||
config.addLiquidFilter( | ||
"htmlToAbsoluteUrls", | ||
pluginRss.htmlToAbsoluteUrls | ||
); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.