img, html optimization; css tweaks; img tweaks; added video; service icon animation fix;

This commit is contained in:
Spencer Flagg
2022-10-07 15:37:57 +02:00
parent 62da575385
commit 69b2c09c39
44 changed files with 3501 additions and 1029 deletions

View File

@@ -1,7 +1,18 @@
const eleventySass = require("eleventy-sass");
//const gsap = require('gsap');
const lazyImagesPlugin = require('eleventy-plugin-lazyimages');
// https://www.npmjs.com/package/eleventy-plugin-img2picture
const img2picture = require("eleventy-plugin-img2picture");
// https://www.npmjs.com/package/@sardine/eleventy-plugin-tinycss
const tinyCSS = require('@sardine/eleventy-plugin-tinycss');
// https://www.npmjs.com/package/@sardine/eleventy-plugin-tinysvg
const tinysvg = require('@sardine/eleventy-plugin-tinysvg');
// https://www.npmjs.com/package/@sardine/eleventy-plugin-tinyhtml
const tinyHTML = require('@sardine/eleventy-plugin-tinyhtml');
module.exports = function (eleventyConfig) {
// passthrus
@@ -9,15 +20,39 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy('src/assets/fonts');
eleventyConfig.addPassthroughCopy("./src/assets/js");
eleventyConfig.addPassthroughCopy('src/assets/images/**/*.png');
eleventyConfig.addPassthroughCopy('src/assets/images/**/*.svg');
eleventyConfig.addPassthroughCopy('src/assets/images/**/*.jpg');
eleventyConfig.addPassthroughCopy('src/assets/images/**/*.gif');
// eleventyConfig.addPassthroughCopy('src/assets/images/**/*.png');
// eleventyConfig.addPassthroughCopy('src/assets/images/**/*.svg');
// eleventyConfig.addPassthroughCopy('src/assets/images/**/*.jpg');
// eleventyConfig.addPassthroughCopy('src/assets/images/**/*.gif');
if (true) {//(process.env.ELEVENTY_ENV === "production") {
eleventyConfig.addPlugin(img2picture, {
// Should be same as Eleventy input folder set using `dir.input`.
eleventyInputDir: "src",
// Output folder for optimized images.
imagesOutputDir: "_site/assets/images",
// URL prefix for images src URLS.
// It should match with path suffix in `imagesOutputDir`.
// Eg: imagesOutputDir with `_site/images` likely need urlPath as `/images/`
urlPath: "/assets/images/",
});
} else {
// During development, copy the files to Eleventy's `dir.output`
eleventyConfig.addPassthroughCopy("src/assets/images");
}
//eleventyConfig.addNunjucksFilter('bitcoin', arr => arr.filter(e => e.name == 'Synapse'));
//plugins
eleventyConfig.addPlugin(eleventySass);
//eleventyConfig.addPlugin(tinyCSS);
eleventyConfig.addPlugin(tinyHTML);
eleventyConfig.addPlugin(tinysvg, {
baseUrl: 'src/_includes/components/svg/',
});
// eleventyConfig.addPlugin(lazyImagesPlugin, {
// imgSelector: 'img:not(.unlazy)', // custom image selector
@@ -28,3 +63,23 @@ module.exports = function (eleventyConfig) {
dir: { input: "src", output: "_site", data: "_data" },
};
};
// module.exports = function (eleventyConfig) {
// if (process.env.ELEVENTY_ENV === "production") {
// eleventyConfig.addPlugin(img2picture, {
// // Should be same as Eleventy input folder set using `dir.input`.
// eleventyInputDir: ".",
// // Output folder for optimized images.
// imagesOutputDir: "_site",
// // URL prefix for images src URLS.
// // It should match with path suffix in `imagesOutputDir`.
// // Eg: imagesOutputDir with `_site/images` likely need urlPath as `/images/`
// urlPath: "",
// });
// } else {
// // During development, copy the files to Eleventy's `dir.output`
// eleventyConfig.addPassthroughCopy("./images");
// }
// };