diff --git a/eleventy.config.js b/eleventy.config.js
index b6d5e7f..34dc380 100644
--- a/eleventy.config.js
+++ b/eleventy.config.js
@@ -15,7 +15,7 @@ dotenv.config();
import yaml from 'js-yaml';
// config import
-import {getAllPosts, showInSitemap, tagList} from './src/_config/collections.js';
+import {getAllPosts, showInSitemap, tagList, goPages} from './src/_config/collections.js';
import events from './src/_config/events.js';
import filters from './src/_config/filters.js';
import plugins from './src/_config/plugins.js';
@@ -42,6 +42,7 @@ export default async function (eleventyConfig) {
eleventyConfig.addCollection('allPosts', getAllPosts);
eleventyConfig.addCollection('showInSitemap', showInSitemap);
eleventyConfig.addCollection('tagList', tagList);
+ eleventyConfig.addCollection('goPages', goPages);
// --------------------- Plugins
eleventyConfig.addPlugin(plugins.htmlConfig);
diff --git a/src/_config/collections.js b/src/_config/collections.js
index a95b365..e83af3b 100644
--- a/src/_config/collections.js
+++ b/src/_config/collections.js
@@ -13,7 +13,34 @@ export const tagList = collection => {
const tagsSet = new Set();
collection.getAll().forEach(item => {
if (!item.data.tags) return;
- item.data.tags.filter(tag => !['posts', 'docs', 'all'].includes(tag)).forEach(tag => tagsSet.add(tag));
+ item.data.tags.filter(tag => !['posts', 'docs', 'all', 'mix', 'project'].includes(tag)).forEach(tag => tagsSet.add(tag));
});
return Array.from(tagsSet).sort();
};
+
+/** goPage URLs. these are defined within a page's Markdown frontmatter as 'go:', and are output as _redirects. the webserver can read this file and redirect users who navigate directly to URL defined in this collection, they will be redirected to the page. **/
+export const goPages = collectionApi => {
+ return collectionApi.getAll().filter(p => p.data.go);
+};
+
+/** All tracks, grouped by project and sorted */
+export const tracksByProject = collectionApi => {
+ const tracks = {};
+ // Get all pages that have a track_number
+ collectionApi.getAll()
+ .filter(item => item.data.track_number !== undefined)
+ .forEach(item => {
+ const project = item.data.project;
+ if (!tracks[project]) {
+ tracks[project] = [];
+ }
+ tracks[project].push(item);
+ });
+
+ // Sort tracks within each project
+ for (const project in tracks) {
+ tracks[project].sort((a, b) => a.data.track_number - b.data.track_number);
+ }
+
+ return tracks;
+};
\ No newline at end of file
diff --git a/src/_includes/partials/card-mix-track.njk b/src/_includes/partials/card-mix-track.njk
new file mode 100644
index 0000000..8eb2c90
--- /dev/null
+++ b/src/_includes/partials/card-mix-track.njk
@@ -0,0 +1,14 @@
+{% set headingLevel = headingLevel | default("h2") %}
+{% set definedDate = definedDate | default(item.date) %}
+
+
{{ meta[page.lang].blog.githubEdit }} - {{ meta.viewRepo.infoText }}.
diff --git a/src/_layouts/mix.njk b/src/_layouts/mix.njk new file mode 100644 index 0000000..0d37a49 --- /dev/null +++ b/src/_layouts/mix.njk @@ -0,0 +1,20 @@ +--- +layout: base +--- + +