Skip to content

Instantly share code, notes, and snippets.

@tadamcz
tadamcz / jekyll_picture_tag_hook.rb
Last active October 20, 2022 20:25
Jekyll picture tag hook: automatic responsive images from pure markdown
# Jekyll plugin to replace Markdown image syntax with {% picture %} tag for crafting responsive images
# Adapted from https://gist.github.com/mmistakes/77c68fbb07731a456805a7b473f47841
# Use as a gem: https://github.com/tadamcz/jekyll-markdown-responsive-image
Jekyll::Hooks.register [:pages, :documents], :pre_render do |post, payload|
file_ext = post.extname.tr('.', '')
# This regex will match all of the following correctly:
#
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@sskylar
sskylar / category-loop1.html
Created April 13, 2017 19:49
Loop through a particular category (or tag) with Jekyll/Siteleaf
{% for post in site.posts %}
{% if post.categories contains 'Foo' %}
<li>{{ post.title }}</li>
{% endif %}
{% endfor %}
@rafszul
rafszul / Putting the “Web” into Webcomics.markdown
Created May 17, 2015 07:12
Putting the “Web” into Webcomics

Putting the “Web” into Webcomics ('-' * 32) Webcomics are enormous, inaccessible bitmaps that don't fit into an increasingly mobile and pixel-dense world. But they don't have to be.

A Pen by Taylor Hunt on CodePen.

License.