No description
  • JavaScript 99.6%
  • CSS 0.2%
  • HTML 0.1%
  • PHP 0.1%
Find a file
2026-05-27 20:49:35 +02:00
src Adds templates handling 2026-05-27 20:49:35 +02:00
.gitignore Init 2026-04-18 13:52:57 +02:00
bun.lock Adds amazing text paragraph system 2026-05-04 15:35:51 +02:00
image.webp Images! HTML! 2026-04-25 23:08:24 +02:00
index.html Adds wordpress article import stuff 2026-05-06 13:03:14 +02:00
index.js Adds templates handling 2026-05-27 20:49:35 +02:00
LeoPressSans.woff2 adds font hotlink, move-to-back, rect, fill 2026-04-22 20:38:03 +02:00
package-lock.json Updates to fonts, scale, paths 2026-04-23 14:51:18 +02:00
package.json Adds amazing text paragraph system 2026-05-04 15:35:51 +02:00
README.md Adds templates handling 2026-05-27 20:49:35 +02:00
socials-carousel-post-builder.php fixes to style and drop 2026-05-06 14:23:35 +02:00
style.css Adds templates handling 2026-05-27 20:49:35 +02:00

Socials Carousel Post Builder

By Matthijs van Loon


This is a plugin (and separate HTML/JS) for WordPress that helps users easily create a bunch of images for use in social media, based on an existing post or other HTML content. It uses FabricJS for Canvas object management, allowing for easy edits like one would do in an image-editor; dragging, text-editting, stuff like that. You can even drag in images and it'll save them to the page. Oh right, most settings and layouts are stored locally. No accounts.

Usage

You drag the plugin folder into WordPress or open up the index.html. Or add the script to your own stuff:

<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css">
<script>
  window.socialsCarouselBuilderOptions = {
    editJSON: true, // allow editting JSON of objects
    dimensions: {
      width: 1080,
      height: 1350
    },
    getData: () => {
      return {
        title: "The commons belongs to us all",
        author: "Creative Commons",
        bodyText: [
          {"text": "body text.", "tagName": "p"},
          {"text": "heading", "tagName": "h2"},
        ]
      }
    }
  }
</script>
<script src="index.js"></script>

Note the return value format of getData. We don't validate the JSON schema there, but it's important that it's the same format. bodyText is an array of bodyText as illustrated, but you can also pass bodyHTML and we'll use Readability to try and parse it for you. Also it's async, so use await appropriately.

Options in the WordPress plugin are set through a filter, socials_carousel_builder_options. By default the system gets the most recent 10 posts as options and puts them above the editor for the user to select. Note that this is JSON, not a PHP array. You have to decode/encode yourself.

Also note that editJSON doesn't do anything right now, and you can't automatically override an image either. Just drag one in and you'll be fine.

Saving and loading templates

Layout data is stored in a JSON format that has elements of FabricJS and our own. Layout data and images are stored locally, but you can export and import to share.

Developing

ParcelJS is used with ReactJS and FabricJS, scripts are in packge. npm run watch will also use ParcelJS' Hot Module Reloading. This may be a bit buggy, so just reload if it doesn't update correctly.

NO AI

No AI code was used in the creation of this piece of software. That's why it's so lean.