Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const yaml = require("js-yaml");
const fs = require("node:fs/promises");

module.exports = function (eleventyConfig) {
eleventyConfig.addShortcode("currentYear", function () {
return new Date().getFullYear();
});
module.exports = (eleventyConfig) => {
eleventyConfig.addShortcode("currentYear", () => new Date().getFullYear());
// Add this line to copy your external assets
eleventyConfig.addPassthroughCopy("src/assets");
// 1. Recognize YAML as a template format
Expand All @@ -20,19 +19,18 @@ module.exports = function (eleventyConfig) {
};
},
getData: async (inputPath) => {
const fs = require("fs/promises");
const content = await fs.readFile(inputPath, "utf-8");
return yaml.load(content);
},
});

// 2. The Randomized Collection
eleventyConfig.addCollection("randomPeople", function (collectionApi) {
eleventyConfig.addCollection("randomPeople", (collectionApi) => {
// Grab all yaml files from the users folder
const people = collectionApi.getFilteredByGlob("src/users/*.yaml");

// Create a copy of the array to avoid mutating the original global collection
let shuffled = [...people];
const shuffled = [...people];

// Fisher-Yates Shuffle
for (let i = shuffled.length - 1; i > 0; i--) {
Expand Down
13 changes: 3 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_stages: [pre-commit, pre-push]
minimum_prek_version: "0.2.22"
minimum_pre_commit_version: "0.2.22"
default_language_version:
python: python3
node: 24.13.0
Expand Down Expand Up @@ -118,17 +118,10 @@ repos:
hooks:
- id: biome-check
name: run biome-check
description: Run Biome linter and formatter for JSON files
description: Run Biome linter and formatter for JS and JSON files
types_or: [javascript, json]
additional_dependencies: ["@biomejs/biome"]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
name: run prettier
types_or: [css, html, javascript, json, markdown, yaml]
additional_dependencies: ["prettier@3.8.1"]

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.47.0
hooks:
Expand Down
6 changes: 3 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.13/schema.json",
"files": {
"includes": ["**/*.json"]
},
"linter": {
"enabled": true,
"rules": {
Expand All @@ -13,5 +10,8 @@
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"files": {
"includes": ["**/*.js", "**/*.json"]
}
}
4 changes: 2 additions & 2 deletions src/_data/build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { execSync } = require("child_process");
const { execSync } = require("node:child_process");

module.exports = () => {
const now = new Date();
Expand All @@ -13,7 +13,7 @@ module.exports = () => {
try {
// Get the short git hash (first 7 characters)
gitHash = execSync("git rev-parse --short HEAD").toString().trim();
} catch (e) {
} catch (_e) {
console.warn("Could not fetch git hash, defaulting to 'development'");
}

Expand Down
Loading