Skip to content

Commit ea07e31

Browse files
committed
Rebase on eleventy
1 parent 00f27cc commit ea07e31

37 files changed

+3239
-348
lines changed

.eleventy.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
2+
const pluginTOC = require('eleventy-plugin-toc');
3+
const markdownItAnchor = require("markdown-it-anchor");
4+
const markdownItReplaceLink = require("markdown-it-replace-link");
5+
6+
module.exports = function(eleventyConfig) {
7+
// Add navigation plugin
8+
eleventyConfig.addPlugin(eleventyNavigationPlugin);
9+
10+
// Add TOC plugin
11+
eleventyConfig.addPlugin(pluginTOC, {
12+
tags: ['h2', 'h3', 'h4'],
13+
ul: true,
14+
wrapper: 'nav'
15+
});
16+
17+
// Configure markdown-it with anchor support and link replacement
18+
eleventyConfig.amendLibrary("md", mdLib => {
19+
mdLib.set({ html: true, linkify: true, typographer: true });
20+
21+
// Add anchor support for headings
22+
mdLib.use(markdownItAnchor, {
23+
permalink: markdownItAnchor.permalink.linkInsideHeader({
24+
symbol: '#',
25+
placement: 'before'
26+
}),
27+
level: [2, 3, 4]
28+
});
29+
30+
// Replace .md links with proper HTML paths
31+
mdLib.use(markdownItReplaceLink, {
32+
replaceLink: function (link, env) {
33+
// Skip external links, anchors only, and non-.md links
34+
if (link.startsWith('http://') ||
35+
link.startsWith('https://') ||
36+
link.startsWith('#') ||
37+
!link.includes('.md')) {
38+
return link;
39+
}
40+
41+
// Remove .md extension and add trailing slash for clean URLs
42+
// Handles both:
43+
// - ./architecture/index.md -> ./architecture/index/
44+
// - application-environment-api.md#anchor -> application-environment-api/#anchor
45+
return link.replace(/\.md(#|$)/, '/$1');
46+
}
47+
});
48+
});
49+
50+
// Set default layout for markdown files
51+
eleventyConfig.addGlobalData("layout", "base.html");
52+
53+
// Copy assets to output
54+
eleventyConfig.addPassthroughCopy("assets");
55+
eleventyConfig.addPassthroughCopy("diagrams");
56+
57+
// Watch for changes
58+
eleventyConfig.addWatchTarget("./ADR/");
59+
eleventyConfig.addWatchTarget("./architecture/");
60+
eleventyConfig.addWatchTarget("./ref/");
61+
62+
// Disable gitignore usage so we can process generated files like ADR/index.md
63+
eleventyConfig.setUseGitIgnore(false);
64+
65+
return {
66+
dir: {
67+
input: ".",
68+
output: "_site",
69+
includes: "_includes",
70+
layouts: "_layouts",
71+
data: "_data"
72+
},
73+
templateFormats: ["md", "html", "njk"],
74+
markdownTemplateEngine: false, // Don't process Markdown with Nunjucks to avoid conflicts with {{ }} syntax
75+
htmlTemplateEngine: "njk"
76+
};
77+
};

.eleventyignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
_site/
3+
.jekyll-cache/
4+
Gemfile.lock
5+
**/.export
6+
.DS_Store
7+
.idea/

.github/workflows/deploy-11ty.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy 11ty site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
cache: 'npm'
29+
30+
- name: Build with Eleventy
31+
run: make build
32+
33+
- name: Move architecture/ dir
34+
run: mv _site/architecture/* _site/.
35+
36+
- name: Setup Pages
37+
uses: actions/configure-pages@v5
38+
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
41+
42+
deploy:
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
runs-on: ubuntu-latest
47+
needs: build
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.github/workflows/gen-deploy-site.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/generate-adr-index.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/generate-api-docs.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
**/.export
22
.DS_Store
3-
.idea/
3+
.idea/
4+
5+
# Node.js
6+
node_modules/
7+
8+
# Build output
9+
_site/
10+
11+
# Jekyll (legacy - can be removed after migration)
12+
.jekyll-cache/
13+
Gemfile.lock
14+
ADR/index.md

Gemfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)