https://github.com/oakstudios/jekyll-siteleaf
A filesystem-less Jekyll reader
https://github.com/oakstudios/jekyll-siteleaf
Last synced: about 1 year ago
JSON representation
A filesystem-less Jekyll reader
- Host: GitHub
- URL: https://github.com/oakstudios/jekyll-siteleaf
- Owner: oakstudios
- Created: 2015-06-19T17:23:23.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-10-14T22:00:39.000Z (over 5 years ago)
- Last Synced: 2025-03-29T01:05:52.453Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 57.6 KB
- Stars: 7
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jekyll-siteleaf
A poorly documented series of monkey patches and refinements to Jekyll that removes the
filesystem dependency from the Jekyll read process. There's really nothing specific to
[Siteleaf](http://v2.siteleaf.com) about it, but it does enable you to read from a database
for instance, which we find handy.
### Basic Usage
The main class is `Jekyll::Siteleaf::Reader` which is a drop in replacement for `Jekyll::Reader`.
Initialize the new reader with a `Jekyll::Site` and a "store", which should be a hash like object
that can respond to `#fetch` and `#keys`.
~~~ ruby
require 'jekyll/siteleaf'
jekyll_site = Jekyll::Site.new(Jekyll.configuration)
jekyll_site.reader = Jekyll::Siteleaf::Reader.new(jekyll_site, store)
~~~
If your store was a literal hash it would look like this:
~~~ ruby
store = {
'index.md' => ['Welcome to my site', { 'title' => 'Home' }],
'about.md' => ['This is what I’m about', { 'title' => 'About' }]
}
~~~
Where the key is a "filename" and the value is an array of content and frontmatter.
### Running tests
```
bundle exec rake test
```