Skip to content

Commit 22b2139

Browse files
Merge pull request #1510 from OctopusDeploy/sf/change-image-handling
Speed up library page
2 parents c8346e6 + 66c388b commit 22b2139

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

app/components/TemplateItem.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default class TemplateItem extends React.Component {
6969
<div className="step-template">
7070
<div className="row clearfix">
7171
<div className="column two-thirds">
72-
<img className="logo" src={"data:image/gif;base64," + this.state.template.Logo} />
72+
<img className="logo" loading="lazy" src={this.state.template.Logo} />
7373
<h2 className="name">{this.state.template.Name}</h2>
7474
<p className="who-when faint no-top-margin">
7575
<i>{this.state.template.ActionType}</i> exported {moment(this.state.template.ExportedAt).calendar()} by

app/components/TemplateList.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export default class TemplateList extends React.Component {
2626
}
2727
let friendlySlug = SlugMaker.make(item.Name);
2828
return (
29-
<li className={"item-summary " + item.ScriptClass} key={index + "." + item.Name}>
30-
<img src={"data:image/gif;base64," + item.Logo} />
29+
<li className={"item-summary " + (item.ScriptClass || "")} key={index + "." + item.Name}>
30+
<img loading="lazy" src={item.Logo} />
3131
<h4 key={index + "." + item.Name + ".0"}>
3232
<Link to={`/step-templates/${item.Id}/${friendlySlug}`}>{item.Name}</Link>
3333
</h4>

gulpfile.babel.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,8 @@ function provideMissingData() {
300300

301301
template.Category = humanize(categoryId);
302302

303-
if (!template.Logo) {
304-
var logo = fs.readFileSync("./step-templates/logos/" + categoryId + ".png");
305-
template.Logo = Buffer.from(logo).toString("base64");
306-
}
303+
// Note: this deprecates base64 encoded images in the template files - they will be ignored
304+
template.Logo = "https://i.octopus.com/library/step-templates/" + categoryId + ".png";
307305

308306
file.contents = Buffer.from(JSON.stringify(template));
309307

0 commit comments

Comments
 (0)