Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattetti/merb-static-pages-slice
Use markdown files to store and serve static pages (about us, contact us, etc)
https://github.com/mattetti/merb-static-pages-slice
Last synced: 3 months ago
JSON representation
Use markdown files to store and serve static pages (about us, contact us, etc)
- Host: GitHub
- URL: https://github.com/mattetti/merb-static-pages-slice
- Owner: mattetti
- License: mit
- Created: 2008-12-12T10:04:43.000Z (about 16 years ago)
- Default Branch: master
- Last Pushed: 2009-04-15T20:17:54.000Z (almost 16 years ago)
- Last Synced: 2024-10-31T06:42:00.934Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 101 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# MerbStaticPagesSlice
Write static content using the markdown format and serve easily in your app.
This slice was extracted/inspired by the work I did on the [Merb Book](http://github.com/mattetti/merb-book)To be able to use this slice, you need to do ``2 things``:
1. mount the slice in your router
2. indicate to the slice where to find your static files
----
To mount the slice in your router, open your router.rb and add:
Merb::Router.prepare do
slice(:merb_static_pages_slice, :path => "static")
endTo set the path to your static files, add the following line in your init.rb (inside the before\_app\_loads block)
Merb::BootLoader.before_app_loads do
::MerbStaticPagesSlice.push_path(:pages, Merb.root / 'app' / 'pages', "**/*.markdown")
end
That's it, now put your static file in your path and enjoy :)To learn more about the syntax, read the [Maruku documentation](http://maruku.rubyforge.org/maruku.html)
- Matt Aimonetti