Social Shots

Addon by Duncan McClean

Social Shots Main Screenshot

Social Shots allows you to create social images for Facebook and Twitter, using HTML, CSS & Antlers.

Installation

You'll first need to install the Social Shots addon, then you'll need to install Puppeteer, the software used under the hood to render your social images.

Addon installation

First, require Runway as a Composer dependency:

composer require doublethreedigital/social-shots

Next, you'll want to publish the default configuration file.

php artisan vendor:publish --provider="DoubleThreeDigital\SocialShots\ServiceProvider"

Puppeteer installation

Under the hood, this addon uses something called Puppeteer (via Browsershot), which provides an easy way to take screenshots via a headless version of Chrome.

Because of this, you'll also need to install Puppeteer where-ever you want to run this addon, in a local environment or on your server.

We've provided some copy & paste snippets which should work for most environments. If these install steps don't work for you, please research setting up Puppeteer for your operating system.

macOS

npm install puppeteer --global

Ubuntu (works for Forge provisioned servers)

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libgbm-dev
sudo npm install --global --unsafe-perm puppeteer
sudo chmod -R o+rx /usr/lib/node_modules/puppeteer/.local-chromium

Documentation

Read the documentation over on the Statamic Marketplace.

Sponsor Duncan

This addon is open-source, meaning anyone can use this addon in their sites for free!

However, maintaining and developing new features for open-source projects can take quite a bit of time. If you're using Social Shots in your production environment, please consider sponsoring me (Duncan McClean) for a couple dollars a month.

Security

Only the latest version of Social Shots (v1.0) will receive security updates if a vulnerability is found.

If you discover a security vulnerability, please report it to Duncan straight away, via email. Please don't report security issues through GitHub Issues.