Skip to content

Commit

Permalink
chore: revert #5069 to restore Netlify builds (#5095)
Browse files Browse the repository at this point in the history
`assetgraph-builder` is used through at least the `buildProduction` command

This reverts commit 53a4baf.
  • Loading branch information
voxpelli authored Feb 15, 2024
1 parent 8317f90 commit 3345eff
Show file tree
Hide file tree
Showing 5 changed files with 2,127 additions and 168 deletions.
8 changes: 8 additions & 0 deletions docs/_data/supporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

'use strict';

const {loadImage} = require('canvas');
const {writeFile, mkdir, rm} = require('fs').promises;
const {resolve} = require('path');
const debug = require('debug')('mocha:docs:data:supporters');
Expand Down Expand Up @@ -114,6 +115,13 @@ const fetchImage = process.env.MOCHA_DOCS_SKIP_IMAGE_DOWNLOAD
);
}
debug('fetched %s', url);
const canvasImage = await loadImage(imageBuf);
debug('ok %s', url);
supporter.dimensions = {
width: canvasImage.width,
height: canvasImage.height
};
// debug('dimensions %s %dw %dh', url, canvasImage.width, canvasImage.height);
const filePath = resolve(SUPPORTER_IMAGE_PATH, supporter.id + '.png');
await writeFile(filePath, imageBuf);
debug('wrote %s', filePath);
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/supporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Use Mocha at Work? Ask your manager or marketing team if they'd help [support](h
{%- if supporter.website -%}
<a href="{{ supporter.website }}" target="_blank" rel="noopener">
{%- endif -%}
<div class="sponsor" title="{{ supporter.name }}" style="background-image: url(/images/supporters/{{ supporter.id }}.png?sprite=sponsors)"></div>
<div class="sponsor" title="{{ supporter.name }}" style="width: {{ supporter.dimensions.width }}px; background-image: url(/images/supporters/{{ supporter.id }}.png?sprite=sponsors)"></div>
{%- if supporter.website -%}
</a>
{%- endif -%}
Expand Down
3 changes: 0 additions & 3 deletions docs/css/supporters.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
-sprite-location: url(/images/sprite-backers.png?pngquant);
-sprite-image-format: png;
-sprite-padding: 0 10;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
width: 32px;
height: 32px;
}
Loading

0 comments on commit 3345eff

Please sign in to comment.