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 |
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 |
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> | |
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
# Outputs the reading time | |
# Read this in “about 4 minutes” | |
# Put into your _plugins dir in your Jekyll site | |
# Usage: Read this in about {{ page.content | reading_time }} | |
module ReadingTimeFilter | |
def reading_time( input ) | |
words_per_minute = 180 |
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: '?>', | |
} | |
}); |
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; | |
} | |
} |
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"> |
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: "", |
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
# First download phantomjs-2.5.0-beta-macos.zip from https://bitbucket.org/ariya/phantomjs/downloads | |
# I put mine into ~/Code/phantomjs-2.5.0-beta-macos | |
~/Code/phantomjs-2.5.0-beta-macos/bin ᐅ ./phantomjs | |
dyld: Library not loaded: /usr/local/opt/webp/lib/libwebp.6.dylib | |
Referenced from: /Users/zachleat/Code/phantomjs-2.5.0-beta-macos/bin/./phantomjs | |
Reason: image not found | |
[1] 33803 abort ./phantomjs | |
~/Code/phantomjs-2.5.0-beta-macos/bin ᐅ brew install webp |
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
<!--[if IE ]><![endif]--> | |
<!doctype html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]--> | |
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]--> | |
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]--> | |
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |