SnS File System
From the root of your Radiant project, run:
git clone git://github.com/nelstrom/radiant-sns_file_system-extension.git vendor/extensions/sns_file_system
The rake tasks that come with
From database to file system
nameis the complete name of your file, as it is stored in the database. If you have a stylesheet called
typography.css, then its name is "typography.css"
.minis included in the filename if you are using the sns_minifier extension, and the current record has
minify = true
The following table shows how the filename is generated for a stylesheet under various circumstances:
name minify sass filename ============== ====== ==== ======================= typography -- -- typography.css typography yes -- typography.min.css typography -- yes typography.sass typography yes yes typography.min.sass typography.css -- -- typography.css.css typography.css yes -- typography.css.min.css typography.css -- yes typography.css.sass typography.css yes yes typography.css.min.sass
If you decide that "typography.sass" should be minified after all, then you can rename it to "typography.min.sass". When
rake file_system:to_db is run, the corresponding database record will have "minify" set to true. If, on the other hand, you decide that you no longer want to use the sass filter, you could rename the file to "typography.css", or "typography.min.css" if you want to minify it.
You are advised to not alter the "name" portion of a filename, after running
rake file_system:to_files. As long as this is left intact, then running
rake file_system:to_db should update the same database record that generated the file in the first place. If you were to alter the "name" part of the filename, then running
rake file_system:to_db would cause the original database record to be deleted, and a new record to be created with the new name. The following scenario outlines a possible gotcha:
Say you're layout loads a stylesheet called "typography.css". It would expect to find a stylesheet called "typography.css". This could be saved to the filesystem as "typography.css.css" (if it was not minified or filtered). Now, if you decided to rename the file to "typography.css" on the file system, then the next time you run
rake file_system:to_db, it would replace the old "typography.css" entry in the database with a new record called "typography". If your layout is still trying to load a file called "typography.css", then it won't find what it is looking for. So if you are tinkering with the "name" portion of a stylesheet on the filesystem, be sure that you update any links to the stylesheet from your layouts.
From file system to database
To load your files from the file system back into the database, just run the command: