feat: add community publishing and news syndication
Validate and deploy production / validate (push) Successful in 23s
Validate and deploy staging / validate (push) Successful in 50s
Validate and deploy production / deploy (push) Failing after 40s
Validate and deploy staging / deploy (push) Failing after 7s

This commit is contained in:
jb
2026-08-01 21:42:09 -04:00
parent b47e2588e9
commit dd84dff055
288 changed files with 83254 additions and 38351 deletions
+47 -28
View File
@@ -6,35 +6,47 @@ import sharp from 'sharp';
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const outputDirectory = path.join(root, 'static', 'brand');
const fontDirectory = path.join(root, 'node_modules', '@fontsource', 'barlow', 'files');
const heavy = opentype.parse(fs.readFileSync(path.join(fontDirectory, 'barlow-latin-900-normal.woff')).buffer);
const medium = opentype.parse(fs.readFileSync(path.join(fontDirectory, 'barlow-latin-700-normal.woff')).buffer);
const fontDirectory = path.join(
root,
'node_modules',
'@fontsource',
'barlow',
'files',
);
const heavy = opentype.parse(
fs.readFileSync(path.join(fontDirectory, 'barlow-latin-900-normal.woff'))
.buffer,
);
const medium = opentype.parse(
fs.readFileSync(path.join(fontDirectory, 'barlow-latin-700-normal.woff'))
.buffer,
);
fs.mkdirSync(outputDirectory, { recursive: true });
const colors = {
background: '#0a0c0d',
surface: '#111415',
border: '#303536',
grid: '#2a3031',
orange: '#f6a821',
white: '#ecebe5'
background: '#0a0c0d',
surface: '#111415',
border: '#303536',
grid: '#2a3031',
orange: '#f6a821',
white: '#ecebe5',
};
function trackedPath(font, value, x, baseline, size, tracking = 0) {
let cursor = x;
let data = '';
for (const character of value) {
const glyph = font.charToGlyph(character);
data += glyph.getPath(cursor, baseline, size).toPathData(2);
cursor += glyph.advanceWidth * size / font.unitsPerEm + tracking;
}
return { data, width: cursor - x - tracking };
let cursor = x;
let data = '';
for (const character of value) {
const glyph = font.charToGlyph(character);
data += glyph.getPath(cursor, baseline, size).toPathData(2);
cursor += (glyph.advanceWidth * size) / font.unitsPerEm + tracking;
}
return { data, width: cursor - x - tracking };
}
function emblem(x, y, size) {
const scale = size / 100;
return `
const scale = size / 100;
return `
<g transform="translate(${x} ${y}) scale(${scale})">
<g fill="none" stroke="${colors.orange}" stroke-width="12" stroke-linecap="butt">
<path d="M73 20A38 38 0 0 0 15 63"/>
@@ -47,10 +59,10 @@ function emblem(x, y, size) {
}
async function writePng(svg, filename, width, height) {
await sharp(Buffer.from(svg))
.resize(width, height, { fit: 'fill' })
.png({ compressionLevel: 9, adaptiveFiltering: true })
.toFile(path.join(outputDirectory, filename));
await sharp(Buffer.from(svg))
.resize(width, height, { fit: 'fill' })
.png({ compressionLevel: 9, adaptiveFiltering: true })
.toFile(path.join(outputDirectory, filename));
}
const transparentLogo = `
@@ -154,10 +166,17 @@ const inviteSplash = `
await writePng(transparentLogo, 'shd-core-segments.png', 1024, 1024);
await writePng(serverIcon, 'shd-build-discord-icon.png', 1024, 1024);
await writePng(banner, 'shd-build-discord-banner-1920x1080.png', 1920, 1080);
await writePng(inviteSplash, 'shd-build-discord-invite-background-1920x1080.png', 1920, 1080);
await sharp(path.join(outputDirectory, 'shd-build-discord-banner-1920x1080.png'))
.resize(960, 540)
.png({ compressionLevel: 9, adaptiveFiltering: true })
.toFile(path.join(outputDirectory, 'shd-build-discord-banner-960x540.png'));
await writePng(
inviteSplash,
'shd-build-discord-invite-background-1920x1080.png',
1920,
1080,
);
await sharp(
path.join(outputDirectory, 'shd-build-discord-banner-1920x1080.png'),
)
.resize(960, 540)
.png({ compressionLevel: 9, adaptiveFiltering: true })
.toFile(path.join(outputDirectory, 'shd-build-discord-banner-960x540.png'));
console.log(`Rendered brand assets to ${outputDirectory}`);