Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pat/radiant-layout-layer
Automatically create Radiant layouts based on HTML files in other extensions
https://github.com/pat/radiant-layout-layer
Last synced: 13 days ago
JSON representation
Automatically create Radiant layouts based on HTML files in other extensions
- Host: GitHub
- URL: https://github.com/pat/radiant-layout-layer
- Owner: pat
- License: mit
- Created: 2009-01-07T13:46:52.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2009-05-18T20:05:36.000Z (over 15 years ago)
- Last Synced: 2024-10-10T20:48:32.107Z (26 days ago)
- Language: Ruby
- Homepage:
- Size: 82 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
Awesome Lists containing this project
README
h1. Layout Layer
This extension only does one job, but it does it well: Automatically creates layouts and snippets based on HTML files in other extensions.
h2. Why?
The reason boils down to the following:
* I don't like writing layouts within a browser
* My layouts are tied to extensionsSo: Any HTML files within an extension's layouts folder (which is not part of the default extension generation) will get replicated to a Layout object within the Radiant application. If it is nested within folders, then the name becomes a Ruby-like indication of this (eg: directory/file.html becomes a layout named Directory::File). Here's a rough example:
- vendor/extensions/site_core
- vendor/extensions/site_core/layouts
- vendor/extensions/site_core/layouts/article.html
- vendor/extensions/site_core/layouts/home.html
- vendor/extensions/site_core/layouts/forums.html
- vendor/extensions/site_core/layouts/forums/topic.html
- vendor/extensions/site_core/layouts/forums/topics.htmlThese layouts get regenerated every time the Rails environment is reloaded. On production systems, this happens when you restart the web server (for example: Mongrel). In development systems, it happens every time you load a page. You should never need to do anything beyond edit the files to see the changes reflected as your developing your intricate CMS.
All the above applies to Snippets as well.
h2. Who is Responsible?
This extension was written in under an hour by "Pat Allan":http://freelancing-gods - that's not meant as a boast, just an indication of how small it is. If you have questions, comments, suggestions, criticisms and/or patches, you can either email pat at freelancing-gods dot com, hassle him on "Twitter":http://twitter.com/pat, or send a message via "GitHub":http://github.com/freelancing-god.