View .eleventy.js
This file contains 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
// via https://www.11ty.dev/docs/languages/handlebars/#optional-set-your-own-library-instance | |
module.exports = function(eleventyConfig) { | |
let handlebars = require("handlebars"); | |
// see https://handlebarsjs.com/guide/partials.html#basic-partials | |
handlebars.registerPartial("name", "Handlebars syntax"); | |
eleventyConfig.setLibrary("hbs", handlebars); | |
}; |
View .eleventy.js
This file contains 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 assert = require("assert"); | |
const inspect = require("util").inspect; | |
module.exports= (eleventyConfig) => { | |
// ever so slightly modified from @pdehaan’s original: | |
// https://github.com/11ty/eleventy/issues/278#issuecomment-873367464 | |
const slugFn = eleventyConfig.getFilter("slug"); | |
const slugifyFn = eleventyConfig.getFilter("slugify"); | |
const slugErrors = new Set(); |
View .eleventy.js
This file contains 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) { | |
eleventyConfig.setBrowserSyncConfig({ | |
snippetOptions: { | |
rule: { | |
fn: function(snippet, match) { | |
return match; | |
} | |
} | |
} | |
}); |
View index.html
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<title></title> | |
</head> | |
<body> | |
View queuecode.js
This file contains 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
/* | |
Queue Code | |
https://queuecode.zachleat.dev/ | |
Usage: | |
- Press any key to reveal the next character of source code. Use delete to hide characters. | |
- Use the `url` query param to point to a different source code file. | |
e.g. https://queuecode.zachleat.dev/?url=https://gist.githubusercontent.com/zachleat/a7393810acf7890e6bef6a34eaa7b78c/raw/smoothscroll.css |
View gist:dd68700493492517ae718c2f148debc2
This file contains 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.js | |
let Nunjucks = require("nunjucks"); | |
module.exports = function(eleventyConfig) { | |
let env = Nunjucks.configure(".", { | |
tags: { | |
blockStart: '<?php', | |
blockEnd: '?>', | |
} | |
}); |
View gist:f100f71a8ad2bad57d65511290717f1c
This file contains 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 |
View smoothscroll.css
This file contains 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; | |
} | |
} |
View gist:8cd9f1844c7144099c54533fff1b0a76
This file contains 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"> |
View .eleventy.js
This file contains 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: "", |
NewerOlder