Automating Jekyll card generation with ruby’s Ferrum gem

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • ferrum

    Headless Chrome Ruby API

  • require "Rubygems" require "Ferrum" def generate_card(browser, card, png, options={}) browser.go_to("http://localhost:4000/cards/#{card}") # see all the options here https://github.com/rubycdp/ferrum#screenshots browser.screenshot(path: "./images/cards/#{png}", full: true, # final image size is window_size x scale scale: 2) end browser = Ferrum::Browser.new(window_size: [800, 418]) # Check what cards we need to make Dir.glob("_posts/*").each do |post| post = File.basename(post, ".md") png = post + ".png" card = post + ".html" generate_card(browser, card, png) unless File.exists?("./images/cards/#{png}") end

  • opengraph

    A python module to parse the Open Graph Protocol

  • I’ve now got a simple, ruby-only, automated way of making Twitter summary cards and OpenGraph image previews for the posts on this blog. Now I just need to iterate on the currently horrible version-zero look of them!

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Jekyll

    :globe_with_meridians: Jekyll is a blog-aware static site generator in Ruby

  • In my Jekyll install I’ve got a _cards symbolic link to my _posts directory, and in my _config.yml I’ve got a defaults section that looks like this:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts