This is a static website built with Deno, Lume (static site generator), and deployed to GitHub Pages.
All commands are run via deno task <command>:
- Build:
deno task build- Runs the full build pipeline (lint, format, build site, copy assets) - Test:
deno task test- Run all tests in thesrc/directory- Single test:
deno test --allow-run=deno --allow-env --allow-read --allow-net src/<filename>.test.ts
- Single test:
- Lint:
deno task lint- Run Deno lint and format - Local server:
deno task serve- Serve built site from_site/directory on port 8000
Other useful commands:
deno task setup- Initial setup (creates directories, installs dependencies)deno task new-post- Generate a new blog post Markdown filedeno task release- Create and push a new release tag (triggers CI/CD)
The build is orchestrated by dev/build.sh which:
- Lints and formats code
- Creates a temporary
build/directory - Copies source files into the build directory structure:
src/styles/→build/_styles/src/templates/→build/_includes/src/layouts/→build/_includes/layouts/content/*→build/(Markdown files with frontmatter)
- Combines and minifies CSS files into
build/_assets/css/styles.min.css - Runs Lume to generate static HTML from Markdown + Nunjucks templates
- Copies static assets (fonts, images, config files) to
_site/ - Generates JSON Feed for blog posts via
src/json-feed.ts - Cleans up
build/directory
Important: Lume config (config/lume.config.ts) is temporarily copied to _config.ts at the project root during build.
content/: Markdown files for pages and posts with frontmatter (e.g.,layout: home.njk)src/: TypeScript source codesrc/layouts/: Nunjucks layout templates (.njk)src/templates/: Nunjucks component templatessrc/styles/: CSS files (combined and minified during build)*.ts: Utility modules (json-feed, posts-list, docker-server)*.test.ts: Deno tests (useDeno.test()with steps)
assets/: Static files (fonts, images, PDFs, favicon, etc.)config/: Configuration files (Lume config, robots.txt, security.txt, keybase.txt)dev/: Bash dev scripts for build automationinfra/: Deployment infrastructureinfra/aws-ecs/: AWS ECS deployment (CloudFormation, Terraform, task definition)infra/deno-deploy/: Deno Deploy deployment (deployctl)
_site/: Built output (generated, not committed)build/: Temporary directory during build (cleaned up after)
Environment variables are loaded from .env (use .env.example as template):
GOOGLE_ANALYTICS_SITE_CODE: GA4 Measurement IDBLOG_POSTS_DIR,BLOG_POSTS_URL: Blog post pathsJSON_FEED_*: JSON Feed metadata (title, description, author, etc.)
These values are passed to Lume templates via site.data() in config/lume.config.ts.
The site uses these Lume plugins:
nunjucks- Template enginedate- Date formattingredirects- URL redirectssitemap- Generate sitemap.xml
Blog posts are published as a JSON Feed at /brendan/posts.json:
- Run via
deno run --allow-read --allow-write --allow-env src/json-feed.ts - Reads Markdown files from
_site/posts/ - Parses frontmatter and content
- Outputs JSON Feed 1.1 format
- See
src/types.tsfor type definitions
- Tests use Deno's built-in test framework with
Deno.test() - Tests use
test.step()for sub-tests - Tests are co-located with source files (e.g.,
json-feed.tsandjson-feed.test.ts) - Tests check for file existence and non-empty content in
_site/directory - Required permissions:
--allow-read --allow-write --allow-env --allow-net --allow-run=deno
CSS is split across multiple files that are concatenated in a specific order:
tools-reset.css- CSS resetsite.css- Base stylesmedia-screen-medium.css- Medium screen responsive stylesmedia-screen-small.css- Small screen responsive stylesmedia-print.css- Print styles
The build process concatenates and minifies these into styles.min.css.
Markdown files in content/ use YAML frontmatter:
---
layout: home.njk
tags: [Social, Work]
draft: false
---See src/types.ts for the YamlData type definition.
Releases use date-based version tags: YYYYMMDD.HHMM (e.g., 20240221.1430)
- Created via
deno task releasescript - Triggers the
.github/workflows/release.ymlworkflow - Workflow runs tests, deploys to GitHub Pages, and creates a GitHub release
Docker support is available via docker/docker-compose.yaml:
deno task docker-dev- Development containerdeno task docker-prod- Production container
See docker/README.md for detailed Docker instructions.
- Formatting configured in
deno.json:- 2 space indentation
- Line width: 120
- Semicolons required
- No tabs
- Linting and formatting scoped to
src/,config/lume.config.ts, anddeno.json