Skip to content

Instantly share code, notes, and snippets.

@zachleat
Forked from crtr0/talk.njk
Last active December 10, 2019 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachleat/2da26a851a45400351d7e1fb39cde261 to your computer and use it in GitHub Desktop.
Save zachleat/2da26a851a45400351d7e1fb39cde261 to your computer and use it in GitHub Desktop.
module.exports = function(eleventyConfig) {
// you’ll have to get a list of all the tags in your talks.json here which is not great but pretty easy
["Web Assembly"].forEach(function(tag) {
eleventyConfig.addCollection(tag, function(collection) {
return collection.getFilteredByTag("talks").filter(item => {
// note here the use of the pagination alias `talk`
return (item.data.talk.tags || []).indexOf(tag) > -1;
});
});
});
};
---
pagination:
data: talks
size: 1
alias: talk
addAllPagesToCollections: true
permalink: "talks/{{ talk.title | slug }}/"
tags: talks
---
{{ talk.title }}
[
{
"event": "cascadiajs-2019",
"speaker": "aaron-turner",
"title": "Building for Budgets",
"tags": [
"Web Assembly"
],
"slides": "https://docs.google.com/presentation/d/1S4vzn3FUMF2kT6GLaipjsb4pxmdPP14P3MVtFDEpXo4/edit?usp=sharing",
"abstract": "A personal story of living in a low income family. With tips on how modern web technologies, like WebAssembly and Web Workers, can bring new experiences to the web for budget devices that struggled to run these experiences before.",
"ytID": "CYVs9hllqZY"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment