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
11 changes: 9 additions & 2 deletions _data/isdevelopment.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
*/

module.exports = function () {
// YOLO.
return /serve|watch/.test(process.argv.join());
try {
// Check if process exists and has argv array (safe for Cloudflare Workers etc)
if (typeof process === "undefined" || !process || !process.argv || !Array.isArray(process.argv)) {
return false;
}
return /serve|watch/.test(process.argv.join());
} catch (e) {
return false;
}
};
18 changes: 18 additions & 0 deletions posts/blog/2026/q1-2026.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "Q1 2026"
date: 2026-04-01
categories:
- "blog"
---

Introduction to Q1 2026.

## January

Lovely weekend away at Brownsover Hall, recently renovated local house. Romantic break with Mrs J, quality time together and loads of different meals (afternoon tea, evening meal and big breakfast). Decor is beautiful and food was pretty good but some of the customer service needs attention with us having to remind many waiters and waitresses for drinks.

Returned the boy to

## February

## March
43 changes: 35 additions & 8 deletions posts/posts.11tydata.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
const todaysDate = new Date();
const isDev = require("../_data/isdevelopment")();

function showDraft(data) {
if (isDev) return true;
function isDev() {
try {
if (typeof process === "undefined" || !process || !process.argv || !Array.isArray(process.argv)) {
return false;
}
return /serve|watch/.test(process.argv.join());
} catch (e) {
return false;
}
}

const isDevEnv = isDev();

function isPublished(data) {
if (!data) return true;
if (isDevEnv) return true;
const isDraft = "draft" in data && data.draft !== false;
const isPostInFuture =
"scheduled" in data ? data.scheduled > todaysDate : false;
return !isDraft && !isPostInFuture;
return !isDraft;
}

function isCollectionVisible(data) {
if (!data) return false;
if (!isPublished(data)) return false;

if (isDevEnv) return true;

// Robustly handle dates
const scheduledDate = "scheduled" in data && data.scheduled ? new Date(data.scheduled) : null;
const postDate = data.date ? new Date(data.date) : todaysDate;

const isScheduledInFuture = scheduledDate && !isNaN(scheduledDate.getTime()) ? scheduledDate > todaysDate : false;
const isPostInFuture = postDate && !isNaN(postDate.getTime()) ? postDate > todaysDate : false;

return !isScheduledInFuture && !isPostInFuture;
}

module.exports = () => {
Expand All @@ -15,9 +42,9 @@ module.exports = () => {
templateClass: "tmpl-post",
eleventyComputed: {
eleventyExcludeFromCollections: (data) =>
showDraft(data) ? data.eleventyExcludeFromCollections : true,
data && isCollectionVisible(data) ? (data.eleventyExcludeFromCollections || false) : true,
permalink: (data) => {
if (!showDraft(data)) return false;
if (!data || !isPublished(data)) return false;

if (data.permalink) return data.permalink;

Expand Down