Skip to content

Commit f81e63e

Browse files
committed
demos page ported
1 parent a65d8fc commit f81e63e

File tree

5 files changed

+35
-49
lines changed

5 files changed

+35
-49
lines changed

.eleventy.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = function(eleventyConfig) {
1515
let resizedImage = await resizeImage(src, width, height, "cover");
1616

1717
let metadata = await Image(resizedImage, {
18-
formats: ["webp", "png"],
18+
formats: ["png"],
1919
outputDir: "out/img"
2020
});
2121

@@ -45,6 +45,9 @@ module.exports = function(eleventyConfig) {
4545

4646
async function resizeImage(src, width, height, mode) {
4747
return await Sharp(src)
48-
.resize({ width: width, height: height, fit: mode })
48+
.resize({ width: width, height: height, fit: mode, options:{
49+
kernel: "nearest",
50+
fastShrinkOnLoad: false
51+
}})
4952
.toBuffer();
5053
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: default.liquid
3+
---
4+
<h1 class="title">{{title}}</h1>
5+
6+
<iframe width="180px" scrolling="0" height="30px" frameborder="0" id="githubBtn-tr-info"
7+
allowtransparency="true"
8+
src="https://ghbtns.com/github-btn.html?user=haxeflixel&amp;repo=flixel-demos&amp;type=watch&amp;count=true&amp;size=large"></iframe>
9+
10+
{{ content }}
11+

11ty-source/demos.liquid

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: "Demos"
3+
layout: "demos-layout"
4+
---
5+
6+
<div class="demo-page center-align-a">
7+
8+
{% for demo in collections.demo-item %}
9+
10+
<a href="{{ demo.url }}" property="dc:title">
11+
<p>{{ demo.data.title }}</p>
12+
{% capture imgURL %}src/files/images/demos/{{ demo.data.title }}.png{% endcapture %}
13+
{% image imgURL, "{{demo.data.title}}", 190, 190 %}
14+
</a>
15+
16+
{% endfor %}
17+
18+
</div>
19+

src/documents/demos.html.eco

-19
This file was deleted.

src/layouts/demos-layout.html.eco

-28
This file was deleted.

0 commit comments

Comments
 (0)