Skip to content

Instantly share code, notes, and snippets.

@YJPL
YJPL / scope-of-work.txt
Last active January 18, 2021 11:26
Scope of work in Markdown for iA Writer
Company: Safespace-Z
Contact: Lem Nosku
Title: Cosmological archeologist
Date: October 29, 2021
Summary: Project summary & why this is something you are good at.
Deliverables: This, this, and that
References: For more details, look here
The_Plan: What is you planned approach?
Budget: It won’t be cheap
MyCompany: M Inc.
@YJPL
YJPL / free-products.html
Created May 25, 2020 20:59
Sorting through products collection in Jekyll -> https://supply.templates.supply/custom-variables/
{% assign products = site.products | where_exp: "product", "product.price contains 'Free'" %}
{% for product in products reversed %}
@YJPL
YJPL / jeyll-image.markdown
Last active July 12, 2021 12:44
Simplified Markdown for Jekyll site images using this plugin: https://gist.github.com/YJPL/48718e28d2b2fda3476aceac018c8f26
![alt text, image of night sky](sky.jpg)
@YJPL
YJPL / img_tag_tansform.rb
Last active October 14, 2022 17:03
Jekyll plugin to replace Markdown images e.g. `![alt description](image.jpg)` with `{% picture %}`. This tag works for collections in addition to posts. Written to work combined with Jekyll Picture Tag. The link opens the original image.
# Description: Jekyll plugin to replace Markdown image syntax with HTML markup, written to work combined with Jekyll Picture Tag
Jekyll::Hooks.register :documents, :pre_render do |document, payload|
docExt = document.extname.tr('.', '')
# only process if we deal with a markdown file
if payload['site']['markdown_ext'].include? docExt
newContent = document.content.gsub(/!\[(.*)\]\(([^\)]+)\)(?:{:([^}]+)})*/, '{% picture default \2 --alt \1 --link /img/\2 %}')
document.content = newContent
end
end