There are two types of markup in Liquid: Output and Tag.
- Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
- Tag markup (which cannot resolve to text) is surrounded by
module Jekyll | |
module CacheBust | |
class CacheDigester | |
require 'digest/md5' | |
attr_accessor :file_name, :directory | |
def initialize(file_name:, directory: nil) | |
self.file_name = file_name | |
self.directory = directory |
// This file goes in /src/transforms/ | |
// Add this line to .eleventy.js: | |
// const eleventyImgTransform = require("./src/transforms/eleventy-img-transform.js"); | |
// And add this one to module.exports in .eleventy.js: | |
// eleventyConfig.addTransform("eleventyImgTransform", eleventyImgTransform); | |
const Image = require("@11ty/eleventy-img"); | |
const cheerio = require("cheerio"); |
const _get = require("lodash.get"); | |
//It seems like, when using these filters on items in a collection with attributes in frontmatter—the keys are mostly on the data object, e.g. `| where('data.key', 'value')`. When using on global data, look for item attributes directly `| where('key', 'value')` | |
//sort by order attribute | |
function sortByOrder(values) { | |
let vals = [...values]; // this *seems* to prevent collection mutation... | |
return vals.sort((a, b) => Math.sign(a.data.order - b.data.order)); | |
} | |
//sort collections by title attribute |
There are two types of markup in Liquid: Output and Tag.
{{ matched pairs of curly brackets (ie, braces) }}
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
NO_COLOR="\[\033[0m\]" | |
RED="\[\033[0;31m\]" | |
export PS1="⚑$RED\$(parse_git_branch) $NO_COLOR\w >" |
$width-tiny: 15em; //4bits | |
$width-small: 30em; //6bits | |
$width-medium: 37.5em; //8bits | |
$width-wide: 57em; //10bits | |
// responsive mixin for bubbled media-querries | |
@mixin responsive($width){ | |
@if $width == tiny-screens{ | |
@media screen and (min-width: $width-tiny){ |
{% assign all_hosts = "" | split: "" %} | |
{% for host in site.data.shared_hosts %} | |
{% assign all_hosts = all_hosts | push: host %} | |
{% endfor %} | |
{% for host in site.data.paas_hosts %} | |
{% assign all_hosts = all_hosts | push: host %} | |
{% endfor %} |
{% capture words %} | |
{{ content | number_of_words | minus: 180 }} | |
{% endcapture %} | |
{% unless words contains “-” %} | |
{{ words | plus: 180 | divided_by: 180 | | |
append: “ minutes to read” }} | |
{% endunless %} |
workflow "Deploy Site" { | |
on = "push" | |
resolves = ["Build and Deploy Jekyll"] | |
} | |
action "Build and Deploy Jekyll" { | |
uses = "BryanSchuetz/jekyll-deploy-gh-pages@master" | |
secrets = ["GITHUB_TOKEN"] | |
} |
--- | |
- | |
image: 01-013 | |
title: sarah williams | |
keywords: sarah, williams | |
caption: portrait of sarah williams | |
- | |
image: 01-014 | |
title: williams family member | |
keywords: portrait, williams |