chrisparrish / radiant-sns-extension

Adds Stylesheet and Javascript management to Radiant
Other
2 stars 0 forks source link

= Styles 'n Scripts Extension

The Styles 'n Scripts extension was an extension requested by John Long as a means of separating javascripts & stylesheets from other site content stored in pages.

== CONTENTS In this README you'll find:

  1. Usage
  2. Why Change Things?
  3. Installation
  4. To Do

== USAGE Using this extension is rather painless. If you can use the rest of Radiant, using these additions should feel obvious. There are a couple of things to take note of, however.

That's it. Everything else is either too obvious to bother with here or automagical and/or too top secret to disclose ;-).

== WHY CHANGE THINGS? As John sees it, the pages tab is for storing your main content. (Think of the tree view as the list of available destinations for your users. Sure, they need stylesheets and javascripts, but those are supporting files -- much like images -- that augment your pages).

There are a number of interesting benefits gained by this approach:

== INSTALLATION

  1. Copy this extension into your existing Radiant project (place it at: [your project location]/vendor/extensions/sns

  2. Incorporate the database migrations into your existing database using: rake db:migrate:extensions

    Or, if you prefer to be more specific to this extension: rake radiant:extensions:styles_n_scripts:migrate

  3. Copy the needed images into Radiant's /public/images directory using: rake radiant:extensions:styles_n_scripts:update

  4. (Optional) Configure your stylesheet and javascript directories. By default The Styles 'n Scripts serves your stylesheets and javascripts out of the /css and /js folders respectively. You can change these locations via the "config" rake task: rake radiant:extensions:styles_n_scripts:config

  5. (Optional) Configure your stylesheet and javascript content (MIME) types. Again, you use the Rake "config" task.

  6. (Optional) Set a different location for the cache directory. This is set in The styles_n_scripts_extension.rb file using TEXT_ASSET_CACHE_DIR

== TO-DO Figure out what the core team needs to get this puppy baked into Radiant!

Add a mechanism to eliminate (or at least reduce) the possibility of circular references with or tags.

Improve the file uploading: Do we need to confirm that it's a text file? Do we need to mess with handling different text encoding? Do we want to allow multiple file uploads?