Droplings: Theme Boilerplate
Droplings is a Mac app to make quick-fire sharing via your Dropbox account easier and more comfortable. Its preferences allow you to specify a custom theme for rendering your shared files' preview pages.
This repository contains a bare-bones theme starter kit: a
all the available placeholders. Feel free to use it as boilerplate for your
How to get started
- Either download starter kit as ZIP file or fork the starter kit repo on Github.
- tell Droplings to use the folder with the
index.htmlin it as custom theme folder (Droplings ➔ Preferences ➔ Theme ➔ Use custom theme…)
- Edit the
index.htmlas you see fit, drop files onto the Droplings icon to see your changes.
The templating process goes like this:
- All non-
.htmlfiles will be copied verbatim to the target folder (
.htmlfiles will be processed by the templating engine. The resulting files will be written to the target folder (using their original names, i.e. an
index.htmlwith placeholders in your theme folder will result in an
index.htmlfilled with live data in the target folder).
- The shared file will be copied to a
fsubfolder in the target directory; its name will be normalized a bit.
- Your theme must contain an
- The templating engine expects UTF-8 encoded files.
- Droplings will ignore subfolders. Only files in the root folder of your theme are recognized.
- There's no reason why your theme can't sport more than one HTML file and/or
JS files. The templating engine won't replace placeholders in JS files,
tho, so if you want to set JS variables, do so in a
<script>block in the HTML file prior to loading your external JS file.
Here's a list of available template keys/variables with their meaning.
file_link: the relative path to the shared file as seen from
file_ext: the normalized file extension (trimmed & lowercase).
file_size: the file size in readable format, eg. "2.70 KB", "5.12 GB".
short_url: the drpln.gs URL leading to the preview page.
original_filename: The name of the file as it was when the file was shared.
is_archive: the file is an archive (zip, tgz, rar etc.)
is_audio: the file is an audio file (mp3, m4a, wav etc.)
is_contact: the file is a vcard file
is_image: the file is an image (png, jpg, tiff, gif etc.)
is_message: the file is a recognized message (email, IM, and so on)
is_pdf: the file is a mixed content file, i.e. a PDF.
is_text: the file is text document (html, rtf, mdown etc.)
is_video: the file is a video (mov, mpg etc.)
is_unknown_type: the file wasn't recognized as one of the files listed above
is_ext_*: a "dynamic" placeholder — for example, if the shared file is a GIF then the placeholder
is_ext_gifwould be set.
The Droplings Theme Boilerplate (this here repository) is licensed under the WTFPL v2.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar 14 rue de Plaisance, 75014 Paris, France Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO.