Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/og-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
paths:
- "_posts/**"
- "assets/og/posts/**"
- "public/assets/og/posts/**"
- "package.json"
- "package-lock.json"
- "scripts/generate-og-images.mjs"
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Site

on:
pull_request:
paths:
- "_posts/**"
- "public/**"
- "scripts/**"
- "src/**"
- "astro.config.mjs"
- "netlify.toml"
- "package.json"
- "package-lock.json"
- "tsconfig.json"

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run check
- run: npm run build
- run: npm test
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
_site
dist
.astro
.og-preview
.impeccable
node_modules
bun.lock
bun.lockb
.sass-cache
.jekyll-metadata
.jekyll-cache
.DS_Store
.DS_Store
/public/assets/css/style.css
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

12 changes: 0 additions & 12 deletions 404.html

This file was deleted.

17 changes: 17 additions & 0 deletions CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Domain glossary

## Post

A dated piece of writing with a title, ordered categories, body, and optional summary. Its ordered categories and filename determine its public URL.

## Post URL

The permanent public location of a Post. It contains every ordered category followed by the filename slug and ends with a trailing slash.

## Legacy redirect

A historical public location that sends readers and crawlers to a Post URL while preventing the historical location from being indexed.

## Social image

The image and dimensions used when a page is shared. Posts use generated, fingerprinted images unless they explicitly provide an override.
16 changes: 0 additions & 16 deletions Gemfile

This file was deleted.

84 changes: 0 additions & 84 deletions Gemfile.lock

This file was deleted.

83 changes: 70 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,71 @@
# adrianmato.com

[![Netlify Status](https://api.netlify.com/api/v1/badges/9482eaf2-54d5-4ee5-a190-5da6e2226aeb/deploy-status)](https://app.netlify.com/sites/adrianmato/deploys)

*Personal website based on Dr Jekyll and Mr Hide running a custom theme.*
Personal website built with Astro and deployed as static HTML.

[![adrianmato.com](/public/assets/preview.png)](https://adrianmato.com)

## Development

```sh
npm ci
npm run dev
```

The site uses Astro templates, Markdown content, Sass, and vanilla browser
JavaScript. It does not use a client-side UI framework or server rendering.

Useful commands:

```sh
npm run build # Build CSS and the production site, then verify its contract
npm run check # Type-check Astro and TypeScript
npm run css:watch # Rebuild the fixed-path stylesheet while editing Sass
npm test # Exercise authoring changes in a disposable copy of the site
```

## Authoring posts and pages

Add posts as dated `.md` files under `_posts/` with `title`,
`date` (a quoted `YYYY-MM-DD HH:mm:ss` timestamp), and ordered `categories`.
Generate their social cards with `npm run og:generate` before building.
The build accepts additional posts while protecting the existing URLs listed
in `scripts/fixtures/published-routes.json`; adding a post does not require
changing a count. The feed includes the newest ten posts.

[![adrianmato.com](/assets/preview.png)](https://adrianmato.com)
Article bodies and the Atom feed use the same Astro-rendered content.
Summaries use the same Markdown processor and settings, including smart
punctuation for prose without altering code. Use public `/assets/` paths for
images in summaries.

[Visit my website](https://adrianmato.com)
For a new standalone page, add its public URL to `SITEMAP_PAGES` in
`src/lib/sitemap.mjs`, or add a documented `SITEMAP_EXCLUSIONS` entry if it
should not be listed. Post URLs are included automatically and legacy redirects
are excluded. The build independently compares the sitemap with all generated
HTML files, so a forgotten page fails with an actionable message.

### Faster local builds with Bun

The committed `package-lock.json`, CI, and Netlify continue to use npm. Install
dependencies only with `npm ci`, not `bun install`. Bun 1.3.13 or newer can
then run the same scripts with lower startup overhead:

```sh
bun run dev
bun run build
bun run check
```

In local benchmarks, `bun run build` was about 34% faster than npm. Bun is an
optional runner here, not a second package manager; Bun lockfiles are ignored
to keep `package-lock.json` authoritative.

## Open Graph image previews

Install the Node dependencies, then generate representative title cards:
Generate representative title cards:

```sh
npm install
npm run og:preview
```

Expand All @@ -25,16 +78,14 @@ node scripts/generate-og-images.mjs \
```

Production cards are rendered at 2400×1260 and committed with the site. New
posts only need their normal `title` front matter; the image path is derived
posts only need their normal `title` frontmatter; the image path is derived
from the dated post filename.

After adding or retitling a post, generate and commit its card and the updated
manifest:
After adding or retitling a post, generate and commit its card and manifest:

```sh
npm ci
npm run og:generate
git add assets/og/posts
git add public/assets/og/posts
```

The pull request check rejects stale generated cards. Netlify publishes the
Expand All @@ -49,6 +100,12 @@ image:
height: 1260
```

The site-wide fallback card at `assets/og-image.png` is managed manually and is
never generated during Netlify builds. After replacing it, bump the `?v=` query
in `_config.yml` so social crawlers request the new image.
Run `npm run og:generate` after setting or removing an override to refresh the
manifest and remove any unused generated card. The build validates the override
URL and dimensions instead of requiring a generated image for that post.
Local image paths must exist; external image availability is not checked by the
offline build.

The site-wide fallback card at `public/assets/og-image.png` is managed manually.
After replacing it, bump its `?v=` value in `src/lib/site.ts` so social crawlers
request the new image.
55 changes: 0 additions & 55 deletions _config.yml

This file was deleted.

1 change: 0 additions & 1 deletion _includes/analytics.html

This file was deleted.

29 changes: 0 additions & 29 deletions _includes/head.html

This file was deleted.

Loading
Loading