begin working on animation support
This commit is contained in:
parent
beaa79b377
commit
9f367cb9b2
9 changed files with 24 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
||||||
const conf = {
|
const conf = {
|
||||||
tags: "blogpost",
|
tags: "blogposts",
|
||||||
layout: "blogpost.njk",
|
layout: "blogpost.njk",
|
||||||
eleventyComputed: {
|
eleventyComputed: {
|
||||||
permalink(data) {
|
permalink(data) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ layout: base.njk
|
||||||
<div class="portfolio-detail-images gallery">
|
<div class="portfolio-detail-images gallery">
|
||||||
{% for image in data.images %}
|
{% for image in data.images %}
|
||||||
<a href="{% imageUrl image.url %}">
|
<a href="{% imageUrl image.url %}">
|
||||||
<img src="{{image.url}}" alt="" loading="lazy" />
|
<img src="{{image.url}}" alt="" loading="lazy" width="600" />
|
||||||
{% if image.caption %}
|
{% if image.caption %}
|
||||||
<div class="gallery-caption">
|
<div class="gallery-caption">
|
||||||
{{image.caption}}
|
{{image.caption}}
|
||||||
|
|
|
@ -4,7 +4,7 @@ permalink: "/blog/"
|
||||||
---
|
---
|
||||||
|
|
||||||
<h1>Blog</h1>
|
<h1>Blog</h1>
|
||||||
{% for post in collections.blogpost | reverse %}
|
{% for post in collections.blogposts | reverse %}
|
||||||
<div>
|
<div>
|
||||||
{{post.data.date | dateLocale}} - <a href="{{ post.data.permalink | safe }}">{{post.data.title}}</a>
|
{{post.data.date | dateLocale}} - <a href="{{ post.data.permalink | safe }}">{{post.data.title}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
BIN
content/portfolio/luxorlive/21.webp
Normal file
BIN
content/portfolio/luxorlive/21.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.9 MiB |
BIN
content/portfolio/luxorlive/ll-flow-2_00000060.webp
Normal file
BIN
content/portfolio/luxorlive/ll-flow-2_00000060.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 MiB |
BIN
content/portfolio/luxorlive/ll-flow-2_00000080.webp
Normal file
BIN
content/portfolio/luxorlive/ll-flow-2_00000080.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 MiB |
|
@ -10,14 +10,15 @@ const conf = {
|
||||||
const dir = path.dirname(data.page.inputPath);
|
const dir = path.dirname(data.page.inputPath);
|
||||||
|
|
||||||
const files = fs.readdirSync(dir)
|
const files = fs.readdirSync(dir)
|
||||||
.filter(file => ['.png', '.jpg', '.jpeg', '.JPG'].includes(path.extname(file)))
|
.filter(file => ['.png', '.jpg', '.jpeg', '.JPG', '.webp'].includes(path.extname(file)))
|
||||||
.sort();
|
.sort();
|
||||||
|
|
||||||
|
|
||||||
const images = await Promise.all(files.map(async (image) => {
|
const images = await Promise.all(files.map(async (image) => {
|
||||||
|
|
||||||
const imagePath = path.resolve(dir + '/' + image);
|
const imagePath = path.resolve(dir + '/' + image);
|
||||||
const exif = await exifr.parse(imagePath, { pick: ['XPComment', 'DateTimeOriginal'] });
|
//const exif = await exifr.parse(imagePath, { pick: ['XPComment', 'DateTimeOriginal'] });
|
||||||
|
const exif = {};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: data.page.url + image,
|
url: data.page.url + image,
|
||||||
|
|
|
@ -87,9 +87,11 @@ body {
|
||||||
flex-wrap: wrap !important;
|
flex-wrap: wrap !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
picture {
|
picture,
|
||||||
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
height: 15rem;
|
height: 15rem !important;
|
||||||
|
max-width: 33.33%;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
|
|
@ -31,7 +31,13 @@ export default async function (eleventyConfig) {
|
||||||
|
|
||||||
//Images
|
//Images
|
||||||
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
|
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
|
||||||
widths: ["700"]
|
widths: ["700"],
|
||||||
|
formats: ["jpeg", "webp", "gif"],
|
||||||
|
useCache: true,
|
||||||
|
sharpOptions: {
|
||||||
|
animated: true,
|
||||||
|
limitInputPixels: false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
eleventyConfig.addShortcode("figure", (url, alt, caption, width) => {
|
eleventyConfig.addShortcode("figure", (url, alt, caption, width) => {
|
||||||
return `
|
return `
|
||||||
|
@ -45,10 +51,15 @@ export default async function (eleventyConfig) {
|
||||||
eleventyConfig.addShortcode("imageUrl", async (image, width) => {
|
eleventyConfig.addShortcode("imageUrl", async (image, width) => {
|
||||||
const img = await Image(`./content${image}`, {
|
const img = await Image(`./content${image}`, {
|
||||||
outputDir: 'dist/img/',
|
outputDir: 'dist/img/',
|
||||||
useCache: true
|
useCache: true,
|
||||||
|
sharpOptions: {
|
||||||
|
animated: true,
|
||||||
|
limitInputPixels: false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return img.jpeg[0].url;
|
const files = img.jpeg ?? img.webp;
|
||||||
|
return files[0].url;
|
||||||
});
|
});
|
||||||
|
|
||||||
//Markdown
|
//Markdown
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue