Simple Rails Blog
A really dead simple blog framework, using Rails. Not multi-user, no fancy admin, just plain functionality.
Targeted at the hacker who wants to have his own customizable blog, without the bells and whistles of other frameworks.
You can post, edit, and delete posts. There is support for uploading images (via CKEDITOR) and tagging posts using autocomplete and tag suggestions.
It uses, among other things:
- Devise for authentication;
- Kaminari for pagination;
- Simple_form for the post/edit form;
- CKEditor (with support for uploading images via carrierwave and imagemagick).
Supports (look in development.rb and production.rb on how to activate):
- Google Analytics tracking
- Livefyre commenting system
- Night mode CSS (look inside application.slim)
Here's a screenie:
Have fun hacking it :)
1. Clone the repo:
$ hg clone https://bitbucket.org/nocivus/simple-rails-blog
2. Setup the development database
simple-rails-blog$ rake db:migrate
I'm not completely sure the database gets created, since i've ommited it from the repo, but you can create it as such, if needed:
simple-rails-blog$ rake db:create
After creating, run the migrate command above.
3. Start the server and check it out at "http://localhost:3000"
simple-rails-blog$ rails s
4. I've included a wordpress migration rake task. It lives under lib/import_posts.rake. Make sure you change the URL and password otherwise you will get errors while using it. The task can be run like so: simple-rails-blog$ rake import_posts
It will retrieve a maximum of posts (specified in a variable) using batches as to not run out of memory (batch size also in a variable). It imports posts and creates (and associates) categories that you might have on the posts.
- The admin interface lives under "http://localhost:3000/admin" but...
- ...Since there will be no users initially in the database, so you won't be able to login;
- User registration is disabled by default;
- To create a user you need to reactivate registration on devise:
- Replace this line "devise :database_authenticatable, :rememberable" with this "devise :database_authenticatable, :rememberable, :registerable"
- In routes.rb replace "devise_for :users, :skip => :registrations" with "devise_for :users"
- Restart server
- Navigate to "http://localhost:3000/users/sign_up" and create the user
- Also, it includes a way to show a post based on a permalink of the following format: "/blog/:year/:month/:day/:slug". Example: /blog/2012/11/06/this-is-a-test-post. Customization for other permalink formats should be easy.
I should probably implement a mechanism to create a user if it doesn't exist, but feeling too lazy for now :)