Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
c72827e
chore: use js exports (eslint)
j-mes Jun 24, 2025
c0472e8
chore: use js exports (eslint)
j-mes Jun 24, 2025
bb2f4e1
chore: use js exports (prettier)
j-mes Jun 24, 2025
0544ab5
chore: add typescript config
j-mes Jun 24, 2025
57c24b8
feat: improved eleventy config
j-mes Jun 24, 2025
62b278c
chore: change publish to build for workflows
j-mes Jun 24, 2025
c162835
chore: add vitest config
j-mes Jun 24, 2025
a059603
chore: update deps/devDeps and misc
j-mes Jun 24, 2025
552a5fd
feat: change from dotdev to j-m.es
j-mes Jun 24, 2025
125a748
chore: change to use tsx template
j-mes Jun 24, 2025
ea57426
feat: add siteLayout JSX template
j-mes Jun 24, 2025
9599112
chore: update to 2025 in LICENSE
j-mes Jun 24, 2025
1d1ce23
chore: change from _site/ to dist for output
j-mes Jun 24, 2025
52e8d62
chore: add support for json/default exports
j-mes Jun 25, 2025
43a30a6
chore: update main tsx template
j-mes Jul 10, 2025
c47ea20
feat: add collections
j-mes Jul 10, 2025
b8f3797
feat: add content permalinks helper
j-mes Jul 10, 2025
377a656
feat: add css processing helper
j-mes Jul 10, 2025
6722a6a
feat: add register collections helper
j-mes Jul 10, 2025
f01eba6
feat: add tsx transforming helper
j-mes Jul 10, 2025
21fad22
feat: update config with modular helpers
j-mes Jul 10, 2025
975a502
chore: move notes in a different place
j-mes Jul 10, 2025
c31592b
chore: move css to assets/styles
j-mes Jul 10, 2025
da75782
chore: move index.md to src/content
j-mes Jul 10, 2025
b2a4b1e
chore: remove redundant helpers
j-mes Jul 10, 2025
5c25507
chore: remove redundant files
j-mes Jul 10, 2025
aebc328
chore: add back in images for notes
j-mes Jul 10, 2025
388d8c2
feat: add image shortcode & update content to use it
j-mes Jul 10, 2025
8e75b91
chore: add image shortcode
j-mes Jul 10, 2025
8bd7b99
feat: update to use tsx for archive, post and main
j-mes Jul 10, 2025
337aeb4
fix: use right template name
j-mes Jul 10, 2025
8a3a1b3
feat: add className to pass through
j-mes Jul 10, 2025
799b2cd
refactor: remove eleventy.config.ts
j-mes Jul 28, 2025
fe128b8
refactor: update package-lock.json
j-mes Jul 28, 2025
5b006bd
refactor: update package.json
j-mes Jul 28, 2025
23a3971
refactor: remove src/assets/styles/index.css
j-mes Jul 28, 2025
fd237e5
refactor: remove src/assets/styles/reset.css
j-mes Jul 28, 2025
1cf0c1c
refactor: remove src/config/data/collections.json
j-mes Jul 28, 2025
bb341b4
refactor: remove src/config/layouts/archive.11ty.tsx
j-mes Jul 28, 2025
920aa50
refactor: remove src/config/layouts/main.11ty.tsx
j-mes Jul 28, 2025
9bd7dce
refactor: remove src/config/layouts/post.11ty.tsx
j-mes Jul 28, 2025
be723c9
refactor: remove src/config/utils/collection-config.ts
j-mes Jul 28, 2025
fbcbed3
refactor: remove src/config/utils/content-permalinks.ts
j-mes Jul 28, 2025
8861471
refactor: remove src/config/utils/css-processing.ts
j-mes Jul 28, 2025
69b34a1
refactor: remove src/config/utils/image-shortcode.ts
j-mes Jul 28, 2025
eed4ccf
refactor: remove src/config/utils/register-collections.ts
j-mes Jul 28, 2025
41ff1ab
refactor: remove src/config/utils/tsx-transforming.ts
j-mes Jul 28, 2025
5a18d6f
refactor: remove src/config/utils/view-props.ts
j-mes Jul 28, 2025
523f19e
refactor: update src/content/index.md
j-mes Jul 28, 2025
54187b1
refactor: update src/content/notes/2020/1.md
j-mes Jul 28, 2025
649f33c
refactor: update src/content/notes/2020/10.md
j-mes Jul 28, 2025
92d5aba
refactor: update src/content/notes/2020/11.md
j-mes Jul 28, 2025
d497d34
refactor: update src/content/notes/2020/19.md
j-mes Jul 28, 2025
49aafeb
refactor: update src/content/notes/2020/2.md
j-mes Jul 28, 2025
85b082c
refactor: update src/content/notes/2020/3.md
j-mes Jul 28, 2025
f429b79
refactor: update src/content/notes/2020/4.md
j-mes Jul 28, 2025
daa409e
refactor: update src/content/notes/2020/49.md
j-mes Jul 28, 2025
c3b104a
refactor: update src/content/notes/2020/5.md
j-mes Jul 28, 2025
9818468
refactor: update src/content/notes/2020/6.md
j-mes Jul 28, 2025
dadf8b5
refactor: update src/content/notes/2020/8.md
j-mes Jul 28, 2025
8f17c77
refactor: update src/content/notes/2020/9.md
j-mes Jul 28, 2025
abff323
refactor: update src/content/notes/2021/49.md
j-mes Jul 28, 2025
73c7dda
refactor: update src/content/notes/2023/32.md
j-mes Jul 28, 2025
90fb658
refactor: update src/content/notes/2024/10.md
j-mes Jul 28, 2025
f264646
refactor: update src/content/notes/2024/2.md
j-mes Jul 28, 2025
29568e5
refactor: update src/content/notes/2024/3.md
j-mes Jul 28, 2025
f6ac35e
refactor: update src/content/notes/2024/4.md
j-mes Jul 28, 2025
af2314c
refactor: update src/content/notes/2024/5.md
j-mes Jul 28, 2025
ef5902e
refactor: update src/content/notes/2024/6.md
j-mes Jul 28, 2025
574815b
refactor: update src/content/notes/2024/8.md
j-mes Jul 28, 2025
7a88836
refactor: remove src/content/notes/index.11ty.ts
j-mes Jul 28, 2025
fc1851d
refactor: remove tsconfig.json
j-mes Jul 28, 2025
d071bff
refactor: remove vitest.config.js
j-mes Jul 28, 2025
be6098c
refactor: add .editorconfig
j-mes Jul 28, 2025
a88b1ab
refactor: add eleventy.config.js
j-mes Jul 28, 2025
6d8b2dd
refactor: add src/content/_data/
j-mes Jul 28, 2025
5d957aa
refactor: add src/content/notes/index.11ty.js
j-mes Jul 28, 2025
dc73359
refactor: add src/content/notes/index.md
j-mes Jul 28, 2025
9202d2d
refactor: add src/helpers/
j-mes Jul 28, 2025
c3c317c
refactor: add src/layouts/
j-mes Jul 28, 2025
f94c943
refactor: add src/styles/
j-mes Jul 28, 2025
635c5cf
docs: add README.md
j-mes Jul 28, 2025
adbb0cd
docs: update documentation
j-mes Aug 18, 2025
c998229
feat: add new source files
j-mes Aug 18, 2025
cc74062
chore: miscellaneous updates
j-mes Aug 18, 2025
e0a1061
chore: other changes
j-mes Aug 18, 2025
aa1c00c
chore: remove unneeded file
j-mes Aug 18, 2025
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
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[*]
indent_style = tab
indent_size = 4
80 changes: 0 additions & 80 deletions .eleventy.js

This file was deleted.

7 changes: 0 additions & 7 deletions .eslintrc

This file was deleted.

11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
extends: ['eslint:recommended', 'prettier', 'plugin:react/recommended'],
plugins: ['prettier', 'react'],
rules: { 'prettier/prettier': ['error'] },
env: { browser: true, node: true, mocha: false, jest: false },
};
6 changes: 3 additions & 3 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
- name: Install packages
run: npm ci

- name: Run npm publish
run: npm run publish
- name: Run npm build
run: npm run build

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./_site
publish_dir: ./dist
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
- name: Install packages
run: npm ci

- name: Run npm publish
run: npm run publish
- name: Run npm build
run: npm run build
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
.env
_site
dist
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
semi: true,
trailingComma: 'all',
singleQuote: true,
useTabs: true,
};
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright (c) 2023 James Loveridge
Copyright (c) 2025 James Loveridge


Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -19,4 +19,3 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.

95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# j-m.es

A static site powered by [Eleventy (11ty)](https://www.11ty.dev/), with a modular helper system for collections, layouts, filters, shortcodes, and a modern CSS pipeline.

## Table of Contents

- [Getting Started](#getting-started)
- [Project Structure](#project-structure)
- [Deployment](#deployment)
- [Helpers Overview](#helpers-overview)
- [Debugging & Troubleshooting](#debugging--troubleshooting)

## Getting Started

**Requirements:**
- Node.js v24+ (managed via [Volta](https://volta.sh/) if desired)
- npm

**Install dependencies:**
```sh
npm install
```

**Run the development server:**
```sh
npm start
```
This starts Eleventy in serve mode with incremental builds.

**Build for production:**
```sh
npm run build
```
Outputs the static site to the `dist/` directory.

**Clean build artifacts:**
```sh
npm run clean
```

## Project Structure

- `src/content/` — Markdown and content files
- `src/layouts/` — Nunjucks layout templates
- `src/styles/` — CSS (processed with PostCSS)
- `src/helpers/` — Modular helper scripts for Eleventy config
- `eleventy.config.js` — Main Eleventy configuration

## Deployment

The site is built with Eleventy and outputs to the `dist/` directory. Deployment is automated using GitHub Actions:

- **Automatic Deployments:**
- On every push to the `main` branch, the workflow in `.github/workflows/build-and-deploy.yml` runs:
1. Checks out the code and sets up Node.js (v24.2.0).
2. Installs dependencies with `npm ci`.
3. Builds the site with `npm run build`.
4. Deploys the contents of the `dist/` directory to the `gh-pages` branch using the `peaceiris/actions-gh-pages` action and a deploy key stored in repository secrets.
- **Custom Domain:**
- The `CNAME` file in `src/` is copied to the root of the deployed site for custom domain support.
- **Preview Builds:**
- On pull requests to `main`, the workflow in `.github/workflows/build.yml` runs a build to ensure the site compiles, but does not deploy.

You do not need to manually deploy; simply push to `main` and the site will be published automatically.

## Helpers Overview

Helpers in `src/helpers/` modularize Eleventy’s configuration:

- **setup-plugins.js**: Register Eleventy plugins (extend as needed).
- **setup-css.js**: Handles CSS build pipeline using PostCSS, autoprefixer, nesting, and minification. Watches for changes in development.
- **setup-passthrough.js**: Configures passthrough copy for static assets (e.g., `CNAME`).
- **setup-global-data.js**: Adds global data and computed values (e.g., permalinks, grouped archives).
- **setup-layout-aliases.js**: Registers layout aliases for all Nunjucks templates in `src/layouts/`.
- **setup-shortcodes.js**: Registers custom shortcodes (e.g., `imageShortcode` for progressive images).
- **setup-filters.js**: Registers custom Nunjucks/Eleventy filters (e.g., `groupByYear`).
- **group-by-year.js**: Groups content entries by year for archive views.
- **compute-permalinks.js**: Computes clean permalinks for content.
- **collections-config.js**: Central config for custom collections (notes, projects, recipes, etc.).
- **setup-collections.js**: Registers custom collections based on `collections-config.js`.
- **setup-eleventy-before.js**: Adds Eleventy event hooks (e.g., debugging layouts).
- **image-shortcode.js**: Shortcode for responsive/progressive images.

## Debugging & Troubleshooting

- **Debugging Layouts:**
Set `DEBUG_LAYOUTS=true` or `DEBUG_LAYOUT_ALIASES=true` in your environment to log layout and alias registration.
- **CSS Issues:**
The CSS pipeline uses PostCSS. If styles are missing, check the build output and ensure all PostCSS plugins are installed.
- **Permalinks:**
If permalinks are not as expected, review `compute-permalinks.js` and the computed data in `setup-global-data.js`.
- **Collections:**
Custom collections are defined in `collections-config.js` and registered in `setup-collections.js`. Check these files if content is missing from expected collections.
- **Static Assets:**
Only specific files (like `CNAME`) are passed through by default. Add more passthroughs in `setup-passthrough.js` as needed.
62 changes: 62 additions & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { setupPlugins } from './src/helpers/setup-plugins.js';
import { setupCSS } from './src/helpers/setup-css.js';
import { setupPassthrough } from './src/helpers/setup-passthrough.js';
import { setupGlobalData } from './src/helpers/setup-global-data.js';
import { setupLayoutAliases } from './src/helpers/setup-layout-aliases.js';
import { setupShortcodes } from './src/helpers/setup-shortcodes.js';
import imageShortcode from './src/helpers/image-shortcode.js';
import { setupFilters } from './src/helpers/setup-filters.js';
import formatDate from './src/helpers/setup-format-date.js';
import truncateWords from './src/helpers/truncate-words.js';
import groupByYear from './src/helpers/group-by-year.js';
import { setupCollections } from './src/helpers/setup-collections.js';
import { setupEleventyBefore } from './src/helpers/setup-eleventy-before.js';

export default function (eleventyConfig) {
// Register Eleventy plugins (see /src/helpers/setup-plugins.js)
setupPlugins(eleventyConfig);

// Setup PostCSS and CSS pipeline
setupCSS(eleventyConfig);

// Tell Eleventy which template formats to process
eleventyConfig.setTemplateFormats(['md', 'njk', 'js']);

// Setup passthrough copy first (static assets)
setupPassthrough(eleventyConfig);

// Setup global data
setupGlobalData(eleventyConfig);

// Setup layout aliases from layouts directory
setupLayoutAliases(eleventyConfig);

// Setup shortcodes
setupShortcodes(eleventyConfig, {
image: imageShortcode
// Add more shortcodes here as needed
});

// Setup filters
setupFilters(eleventyConfig, {
groupByYear,
date: formatDate,
truncateWords,
// Add more filters here as needed
});

// Setup custom collections
setupCollections(eleventyConfig);

// Setup event hooks (e.g., eleventy.before)
setupEleventyBefore(eleventyConfig);

return {
dir: {
input: 'src/content', // source files location (content root)
includes: '../layouts', // includes and layouts folder (relative to input)
layouts: '../layouts', // layouts folder path (relative to input)
output: 'dist', // output folder
},
};
}
Loading