Skip to content
Merged
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
37 changes: 37 additions & 0 deletions .github/actions/config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,41 @@ module.exports = {
* @type {Object}
*/
workflow: {
/**
* Public domain identity for the published website
*
* Defines the canonical hostname and protocol of the deployed website.
* Used to expand `<!--mdx-variable-domain-->` placeholders in entry
* bodies during the upload pass, so authors can reference the live URL
* symbolically and the resolved value is baked into the R2 object once,
* never re-evaluated at render time.
*
* @type {Object}
*/
domain: {
/**
* Hostname of the published website
*
* The bare domain name without protocol or trailing path. Combined
* with `protocol` to form the full URL when expanding placeholders.
*
* @type {string}
* @default 'axivo.com'
*/
name: 'axivo.com',

/**
* Transport protocol for the published website
*
* The scheme used to reach the website. Combined with `name` to form
* the full URL. Always `https` for production traffic.
*
* @type {string}
* @default 'https'
*/
protocol: 'https'
},

/**
* Standard labels to apply to workflow-generated issues
*
Expand Down Expand Up @@ -232,5 +267,7 @@ module.exports = {
* @default 'workflow: Issues Detected'
*/
title: 'workflow: Issues Detected'


}
};
8 changes: 8 additions & 0 deletions .github/actions/services/Bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const { DeleteObjectCommand, DeleteObjectsCommand, ListObjectsV2Command, PutObje
const { slug: githubSlug } = require('github-slugger');
const { existsSync, readFileSync, readdirSync, statSync } = require('node:fs');
const { basename, dirname, join } = require('node:path');
const config = require('../config');
const blogPrefix = 'blog';
const contentPrefix = 'src/content';
const features = {
Expand Down Expand Up @@ -166,13 +167,20 @@ class BucketService {
throw new Error(`Invalid UUID "${match[1]}" in <!--mdx-component--> block (${filePath})`);
}
}
const domain = config.get('workflow.domain');
const variables = {
domain: `${domain.protocol}://${domain.name}`
};
let entryContent = body;
entryContent = entryContent.replace(/<!--mdx-strip-start-->[\s\S]*?<!--mdx-strip-end-->\n?/g, '');
entryContent = entryContent.replace(/<!--mdx-component-[a-f0-9-]+\n([\s\S]*?)-->/g, (_, block) => block.trim());
entryContent = entryContent.replace(/(?<![\w.\/-])\/blog\/(\d{4})\/(\d{2})\/(\d{2})\.md/g, `/${blogPrefix}/$1/$2/$3`);
entryContent = entryContent.replace(/(?<![\w.\/-])\/blog\/(\d{4})\/(\d{2})\/media\//g, `/${blogPrefix}/$1/$2/`);
entryContent = entryContent.replace(/\n{3,}/g, '\n\n').trim();
entryContent = entryContent.replace(/https:\/\/axivo\.com/g, '');
for (const [name, value] of Object.entries(variables)) {
entryContent = entryContent.replace(new RegExp(`<!--mdx-variable-${name}-->`, 'g'), value);
}
return [{ frontmatter: fm, slug, title, body: entryContent }];
}

Expand Down
4 changes: 2 additions & 2 deletions blog/2026/04/21.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ The Worker handles the gap by overwriting `Vary` to `Accept-Encoding` on cacheab
A simple diagnostic with two consecutive HEAD requests to the homepage:

```shell
$ curl -sI https://axivo.com | grep -iE "age:|cf-cache-status|cf-ray"
$ curl -sI <!--mdx-variable-domain--> | grep -iE "age:|cf-cache-status|cf-ray"
cf-ray: 9f194d1d2bd4ab7c-YYZ

$ curl -sI https://axivo.com | grep -iE "age:|cf-cache-status|cf-ray"
$ curl -sI <!--mdx-variable-domain--> | grep -iE "age:|cf-cache-status|cf-ray"
cf-ray: 9f194d2bdda437a1-YYZ
cf-cache-status: HIT
age: 2
Expand Down