Skip to content

Commit 80af7f1

Browse files
committed
push updates
1 parent 0143e1d commit 80af7f1

7 files changed

Lines changed: 446 additions & 25 deletions

File tree

.eleventy.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ const yaml = require("js-yaml");
22

33
module.exports = (eleventyConfig) => {
44
eleventyConfig.addShortcode("currentYear", () => new Date().getFullYear());
5-
// Add this line to copy your external assets
65
eleventyConfig.addPassthroughCopy("src/assets");
7-
// 1. Recognize YAML as a template format
86
eleventyConfig.addTemplateFormats("yaml");
97

10-
// 2. Define how to process YAML files
118
eleventyConfig.addExtension("yaml", {
129
key: "yaml",
1310
compile: async (inputContent) => {
1411
const data = yaml.load(inputContent);
1512
return async () => {
16-
// This returns the 'content' for the page (the bio)
1713
return data.bio || "";
1814
};
1915
},
@@ -24,15 +20,10 @@ module.exports = (eleventyConfig) => {
2420
},
2521
});
2622

27-
// 2. The Randomized Collection
2823
eleventyConfig.addCollection("randomPeople", (collectionApi) => {
29-
// Grab all yaml files from the users folder
3024
const people = collectionApi.getFilteredByGlob("src/users/*.yaml");
31-
32-
// Create a copy of the array to avoid mutating the original global collection
3325
const shuffled = [...people];
3426

35-
// Fisher-Yates Shuffle
3627
for (let i = shuffled.length - 1; i > 0; i--) {
3728
const j = Math.floor(Math.random() * (i + 1));
3829
[shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules
44
vendor
55
.venv
66
src/assets/css/tailwind.css
7+
src/assets/js/bundle.js

0 commit comments

Comments
 (0)