The project itself has a very good documentation.
- 11tybundle - huge link collection
- Awesome Eleventy
- 11ty Plugin Repository
/** | |
* Split the content into excerpt and remainder | |
* | |
* @param {String} str | |
* @param {String [excerpt | remainder]} section | |
* | |
* If excerpt or nothing is passed as an argument, we return what was before the split marker. | |
* If remainder is passed as an argument, we return the rest of the post | |
* | |
*/ |
a { | |
color: #C0281C; | |
text-decoration: none; | |
background-image: linear-gradient(currentColor, currentColor); | |
background-position: 0% 100%; | |
background-repeat: no-repeat; | |
background-size: 0% 2px; | |
transition: background-size .3s; | |
} |
function toggleFullScreen() { | |
if ((document.fullScreenElement && document.fullScreenElement !== null) || | |
(!document.mozFullScreen && !document.webkitIsFullScreen)) { | |
if (document.documentElement.requestFullScreen) { | |
document.documentElement.requestFullScreen(); | |
} else if (document.documentElement.mozRequestFullScreen) { | |
document.documentElement.mozRequestFullScreen(); | |
} else if (document.documentElement.webkitRequestFullScreen) { | |
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); | |
} |
/* | |
Usage: | |
eleventyConfig.addCollection("tagList", require("11ty_getTagList.js") ); | |
This collection then produces a useful list... | |
for tag in collections.tagList... | |
which then gives access to |
// Stolen from https://stackoverflow.com/a/31615643 | |
const appendSuffix = n => { | |
var s = ['th', 'st', 'nd', 'rd'], | |
v = n % 100; | |
return n + (s[(v - 20) % 10] || s[v] || s[0]); | |
}; | |
module.exports = function dateFilter(value) { | |
const dateObject = new Date(value); |
The project itself has a very good documentation.
$fontBasePath: "../fonts/"; | |
@mixin ff($name, $style, $weight, $path){ | |
@font-face { | |
font-family: '#{$name}'; | |
font-style: #{$style}; | |
font-weight: $weight; | |
src: local(''), | |
url($fontBasePath+$path+'.woff2') format('woff2'), | |
url($fontBasePath+$path+'.woff') format('woff'); | |
} |
@mixin ff($name, $weight, $path){ | |
@font-face { | |
font-family: '#{$name}'; | |
font-style: normal; | |
font-weight: $weight; | |
src: local(''), | |
url('../fonts/'+$path+'.woff2') format('woff2'), | |
url('../fonts/'+$path+'.woff') format('woff'); | |
} | |
} |
$left-width-initial: 95px; | |
$left-width-sm-up: 110px; | |
$left-width-lg-up: 123px; | |
$image-ml: 16px; | |
$image-path: "test/"; | |
$icon: test; | |
$selector: ""; |
.sitefooter { | |
$parent: &; | |
border-top: 2px solid blue; | |
padding: 20px 0; | |
#{$parent}--home { | |
color: red; | |
} | |