GitHub/IDE Development Integration

When doing rapid development or prototyping of an app, it can be time consuming to upload via the Dev Admin portal. For themes, it's time consuming to upload using the theme editor. To remedy this, we've put together a CLI Ruby Gem that streamlines this process. The gem zips and uploads your files for an app or theme to Weebly, and installs it to your Developer Test Site. You can use this gem with your development process, so that anytime you update files, you trigger an upload of your updates to Weebly.

Note: While you don't have to version the app each time you upload, if you don't, any app zip file with the same version number is overwritten with the files you upload.

In this topic:

Install the Gem

You can install using RubyGems (recommended) or manually.

Prerequisites:

Install RubyGems. You can follow the installation instructions on the official RubyGems Installation page (Windows users, please be sure to download the correct Ruby installer for your system from the official Ruby download page, as well as the appropriate development kit).

Download the Weebly Bundler gem from our GitHub page to a directory named weeblybundler.

​To install using RubyGems:Navigate to the directory where you have downloaded the gem and enter:

To manually install:​Download the source code :

Change to that source directory and install dependencies, including the Weebly Bundler.

Run the following from the weeblybundler directory to install the gem to your gemset.

Use the Gem to Upload an App

When you use the bundler, if your app is still in a draft state and you upload without changing the version, the new zip is automatically installed to your developer test site and the previous version is overwritten. If you change the version, then previous versions are retained but you'll need to install it manually to your site.

Set your client_id and secret as environment variables. This is how the gem will know the correct site to install the app to. These values are shown on the app's management page in the Dev Admin portal.

To use the gem to upload an app:Run the following, where /Path/To/Element/Directory is the path to where your app's zip file is located on your machine:

Use the Gem to Upload a Theme

When you upload a theme, it will display under Theme > Change Theme > Custom, but it will only display for a specific site.

Prerequisites:​​Set your email (﻿account﻿), site_id and platform api token as environment variables. This is how the gem will know the correct site to install the theme to. To find these values, in the Weebly editor for your test site, click Settings. The values are listed in the Platform API Token section. If they're not listed, click Generate Token. Then set the variables:

To use the gem to upload a theme:Run the following, where /Path/To/Theme is the path to your theme's zip file in your local directory.

Note: If the theme does not display properly in Weebly, it could be because the theme's zip file is not constructed correctly. The zip file must contain the contents of the theme's root directory, and NOT the root directory folder itself. If you create your zip from a source control app like GitHub, the zip may include that root folder. You'll need to extract and then rezip only the contents (and not the root directory) before importing into Weebly.

Rapid Prototype with the Gem

To get the most out of the Weebly Platform, we recommend using the--watch flag that monitors a directory and runs the gem automatically. To use the flag, run the following:

Anytime you change a file in that directory, the gem runs: the files are zipped and that zip file is uploaded to your site. Refresh your browser to view the updated app or theme in Weebly.

For apps, if you've updated the version in the manifest, you'll need to install the new version to the site from the Dev Admin portal. If the version hasn't changed, the changes are automatically added to the editor, you just need to refresh to see the changes.

If you need general help with your Weebly account, please contact our Support Team here: hc.weebly.com