This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------- | |
Eleventy Benchmark (Node v14.9.0, 1000 templates each) | |
--------------------------------------------------------- | |
Eleventy 0.10.0 | |
--------------------------------------------------------- | |
liquid: ... 3 runs | |
* Median: 1.02 seconds | |
* Median per template: 1 ms | |
njk: ... 3 runs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
scroll-behavior: smooth; | |
} | |
@media (prefers-reduced-motion: reduce) { | |
html { | |
scroll-behavior: auto; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<responsive-image | |
path="./src/images/home-store.jpg" | |
alt="The front entrance to a store" | |
:widths="[350, null]" /> | |
<!-- BECOMES --> | |
<picture> | |
<source srcset="/v3/img/respimg/ef7c5bc4-350.webp 350w, /v3/img/respimg/ef7c5bc4.webp 589w" type="image/webp"> | |
<source srcset="/v3/img/respimg/ef7c5bc4-350.jpeg 350w, /v3/img/respimg/ef7c5bc4.jpeg 589w" type="image/jpeg"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const eleventyVue = require("@11ty/eleventy-plugin-vue"); | |
module.exports = function(eleventyConfig) { | |
// Use Defaults | |
eleventyConfig.addPlugin(eleventyVue); | |
// OR, Use your own options | |
eleventyConfig.addPlugin(eleventyVue, { | |
// Directory for single file components (defaults to includes folder) | |
componentsDirectory: "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(eleventyConfig) { | |
// you’ll have to get a list of all the tags in your talks.json here which is not great but pretty easy | |
["Web Assembly"].forEach(function(tag) { | |
eleventyConfig.addCollection(tag, function(collection) { | |
return collection.getFilteredByTag("talks").filter(item => { | |
// note here the use of the pagination alias `talk` | |
return (item.data.talk.tags || []).indexOf(tag) > -1; | |
}); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- throws an error, missing [alt] attribute --> | |
{% img src="img/9a93578a.png", loading="lazy" %} | |
<!-- local img source, outputs a standard <img> tag --> | |
{% img src="img/9a93578a.png", alt="zachleat’s Avatar", loading="lazy" %} | |
<!-- remote img source --> | |
<!-- download using avatar-local-cache, outputs <picture> with webp and png fallback --> | |
{% img src="https://www.gravatar.com/avatar/e1899004c71c7043343196103e210be3?default=404", alt="zachleat’s Avatar", loading="lazy" %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Eleventy = require("@11ty/eleventy"); | |
(async function() { | |
let inst = new Eleventy(); | |
await inst.init(); | |
await inst.write(); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "entry", | |
"author": { | |
"type": "card", | |
"name": "", | |
"photo": "", | |
"url": "" | |
}, | |
"url": "https://remysharp.com/2019/06/11/ejecting-disqus", | |
"published": "2019-06-11T00:00:00", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
let fontSizes = new Set(); | |
document.querySelectorAll("*").forEach(function(node) { | |
fontSizes.add(window.getComputedStyle(node).getPropertyValue("font-size")); | |
}); | |
return Array.from(fontSizes).sort(); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function ($) { | |
function Lettering() {} | |
Lettering.prototype.splitText = function() {}; | |
Lettering.prototype.injector = function() {}; | |
window.LetteringJS = Lettering; | |
})(jQuery); |